d3d12/list: more list threads where the processor has slow cores (D3D12-THIN-WIDE-HYBRID) #3411
Code
Clone this repository
Checkout
From your project repository, check out a new branch and test the changes.
git fetch -u"d3d12-thin-wide-hybrid:Rockcabbage-d3d12-thin-wide-hybrid" git switch "Rockcabbage-d3d12-thin-wide-hybrid"
Open
leonida/mandy
Rockcabbage
wants to merge 5 commits from
Rockcabbage/mandy:d3d12-thin-wide-hybrid into main
pull from: Rockcabbage/mandy:d3d12-thin-wide-hybrid
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!3411
Loading…
Reference in a new issue
No description provided.
Delete branch "Rockcabbage/mandy:d3d12-thin-wide-hybrid"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request has changes conflicting with the target branch.
Merge manually to resolve the conflicts.
Reviewers 0 approvals
Details
This pull request has changes conflicting with the target branch.
Merge manually to resolve the conflicts.
d3d12/docs/findings.mdView command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Claimed in the coordination issue as:
D3D12-THIN-WIDE-HYBRID(#3312). Related: #3140, closed, a docs pull request about four list threads on an i5-12600K. This change leaves that PC's count as it is.mainat312d88d1d.d3d12-thin-wide-hybridat84180e52e.This was ready on GitHub before the move but was never opened there. It is the same change as one commit on current
main.What and why
On processors with a slower class of cores (Intel hybrid), more of the threads that translate the title's lists now take work by default.
The count. It is the slow logical processors less 4 (room for our submitting, relay and helper threads), at most 12, and never fewer than
LEONIDA_THIN_THREADS.LEONIDA_THIN_THREADS_WIDEsets it explicitly.LEONIDA_THIN_WIDE. It is on unless set to0, and it can be flipped by turns underLEONIDA_AB. With0,LEONIDA_THIN_THREADSthreads take work, as before.Starting and parking. The larger count is started once. Threads past the working count stay parked and look at the switches every 2 ms, as
LEONIDA_THIN_PARKalready did.LEONIDA_THIN_PARKnow uses the same parking. A wake-up that a thread takes while it is past the working count is passed on to a working thread.A ready-queue meter. It runs under the queue's existing lock and measures:
The meter goes on the frame-rate log line and into
LEONIDA_AB's counters:list_ready_ns,list_ready_starved_ns,list_ready_waits_nsandlist_ready_deep_ns.cores::slow_processors(). It counts the CPU sets whose efficiency class is below the best one. It returns 0 where all are alike.Who is affected:
LEONIDA_THIN_THREADS, and the same number of threads is started and works.Why more threads help there:
play-nvidia.ps1dates from66b486735. It was tuned on a 6-core Ryzen 5 7600X, where the title's threads waited for a core while 8 list threads stood idle 39 % of their time.Measured
These measurements were taken before the move, on the earlier head (the same diff on the main of that time,
ff8b4965c). They were not taken again on this base.The setup:
LEONIDA_THIN_THREADS=6.LEONIDA_AB).The first runs were on a local tree (that main plus local work), of which this pull request carries only the list-threads part:
list_ready_starved)Then, on the change alone, before the move: 470 s with the window up (about 360 s in the world), walking at 8,000-12,000 draws, no device lost, no panic, no errors.
diagnostics,dlss,mimalloc), frames of 40-44 ms: median −2.367 ± 0.242 ms (6 pairs),list_ready_starved−19.7 ms.list_ready_starved−18.2 ms. There something other than translation limits the frame, so the wider count neither helps nor hurts.Memory: each extra thread keeps three things.
That is about 1.5-2.5 MB a thread. On an i9-13900K with the launcher's 6, it adds 6 threads, about 9-15 MB.
Files:
d3d12/crates/leonida-gpu/src/list/thin.rs: the pool, the working count, parking, the meter and the tests.cores.rs:slow_processors().ab.rs: the counters.d3d12/scripts/play-nvidia.ps1: a comment only; no setting changes.d3d12/docs/findings.md: a new section at the end.d3d12/docs/switches.md: regenerated withtools/d3d12_switches.py.Tested
On this branch, on
main312d88d1d.New unit tests:
list::thin::tests::the_wider_count_follows_the_slow_processorsthe_pool_starts_the_larger_count_and_works_with_the_one_askedthe_ready_meter_counts_time_by_depthdepths_fall_in_their_partsa_wake_up_a_parked_thread_took_goes_on_to_a_working_oneslow_ofcases incores::testsRed and green, by reverting the source by hand:
mainthe new tests do not build, because the functions are new.Commands run:
cargo check -p leonida-gpu, with and without--features diagnostics: clean on this change's lines. The diagnostics build has one warning, inbook.rs; it is onmaintoo.cargo test -p leonida-gpu --lib --locked: 734 passed, 0 failed, 59 ignored. With--features diagnostics: 815 passed, 0 failed, 59 ignored.cargo build --workspace --all-targets --locked: builds.cargo test --workspace --exclude xtask --locked --no-fail-fast: 1,775 passed, 0 failed, 75 ignored. An earlier run of the same command failedtitle_range::tests::a_request_at_a_held_address_is_made_thereandupload::tests::arenas_take_the_held_range_and_keep_others_out("another thread took part of the test range"). Both pass alone and in the full run; that is a race between parallel tests onmain's test ranges, not this change.python -I tools/d3d12_switches.py --check d3d12/docs/switches.md: passes.python -I scripts/check_no_game_data.pyon the changed files: exit 0.python -m unittest discover -s tests -p "test_docs_*.py": 59 tests OK.GPUs tested: NVIDIA GeForce RTX 4090, driver 621.24, Windows 11 (CPU: Intel i9-13900K)
AI-assisted: yes. Claude Code; Claude Fable 5.2 directing, Claude Opus 5.5 writing and reviewing.
findings.mdnamed two commits by hashes that do not exist in this server's history. The follow-up commit names them by their hashes here (66b486735andff8b4965c).Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
In-game run report, exe built at
84180e52e(the head is now0e67f39d2, a merge ofmainthat touches only the progress dashboard)-HardwareRT -NoFrameGen, diag build (diagnostics,dlss,mimalloc),LEONIDA_WINDOWS_BAR_MB=8192, launcher'sLEONIDA_THIN_THREADS=6. The log saysstarted=12 asked=6 wide=12.LEONIDA_AB=20,LEONIDA_THIN_WIDEflips the count by turns of 20 s.By turns, wide (12) minus 6, 10 pairs (2 left out for a draw jump):
list_ready_starvedlist_readymainfrom that spot yet to say whethermaindraws it the same; I will add one.AI-assisted: yes (Claude Code; run started and its log and pictures read by Claude Fable 5.2).
A second read-only review of this branch (Claude Opus 5.5), and what changed for it. The head is now
1b3c0635c, withmaina9361504amerged in; the hashes in the description are older. The merge conflicted infindings.mdonly (both sides added a section at the end); both are kept.What the review checked
LEONIDA_THIN_THREADS); an i5-12600K stays at 6 and machines with no slow cores keep their count.cargo test -p leonida-gpu --lib --lockedon the merged head: 742 passed, 0 failed, 60 ignored.Changed (
b58a2a0e4, wording only)"Threads past the working count stay parked" was not exact. A thread already waiting for work when a turn of
LEONIDA_ABlowers the count stays in that wait until a wake-up reaches it; it then passes the wake-up on and parks. The comment onPooland the findings line say so now. Right after such a turn the starved time can read a little low for that reason.Corrections to the description
Instant::now()under the queue's lock when a recording is scheduled, one when it is taken, and two more for each wait, plus two or three atomic adds when the queue is not empty. I have not measured that cost on its own. If you would rather have the meter behinddiagnostics, say so and I will move it.a_wake_up_a_parked_thread_took_goes_on_to_a_working_onedepends on which thread Windows wakes, so "fails in 10 of 10" is what happened here, not a guarantee. The green step passes whichever thread is woken.🤖 Generated with Claude Code
A synthetic scheduler check could feed the same bursty command-list arrival trace to the default and wider worker pools. Hold list sizes and cache state fixed. Compare median and P99 completion time, the count above a fixed stall threshold, and the
list_ready_starved_nsdelta. This would test whether the wider pool reduces readiness starvation when arrivals are uneven.AI-assisted with OpenAI Codex.
I checked the offline ready-queue reader with two fully generated archives. In the first, the complete intervals covered one and three Presents. The time with ready work and no free worker was 4.0 and 0.0 ms per Present, respectively. Weighting by the four covered Presents returned 1.0 ms per Present.
In the second archive, one ready-queue report said
LEONIDA_THIN_WIDE=0while the capture declared1. The reader rejected it. The two checks validate the metric and arm identification for the planned worker-pool comparison. Earlier proposed checkAI-assisted.