d3d12: opt-in RDNA target-barrier, list raw-twin, and wave-32 switches for #2771 / #2770 #2834
Code
Clone this repository
Checkout
From your project repository, check out a new branch and test the changes.
git fetch -u origin "github-pr/2834:github-pr/2834" git switch "github-pr/2834"
Open
leonida/mandy
zmasi wants to merge 20 commits from
github-pr/2834 into main
pull from: github-pr/2834
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/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
1 participant
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!2834
Loading…
Reference in a new issue
No description provided.
Delete branch "github-pr/2834"
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/crates/leonida-gpu/src/list.rsd3d12/docs/switches.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.Summary
Refs #2771, #2770 (
D3D12-RDNA-GBUFFER-TERRAIN-TILES).Because #2771 (RX 7800 XT, RDNA 3) and #2770 (RX 9070 XT, RDNA 4) reproduce only on RDNA 3 / RDNA 4 hardware in outdoor scenes and our local test machine has an RTX 3090 + WARP with no retail game data, the root cause is not claimed as proven here. Instead of changing default runtime behaviour unmeasured, this PR lands the three concrete AMD-relevant gaps between Mandy and
monte-alt/vesper(7b7e556, GPL-3.0) as opt-in switches — all off by default — with per-frame diagnostic counters and hardware/WARP unit tests so RDNA 3 / RDNA 4 testers can isolate the exact mechanism in a single A/B pass.With all three switches unset (the default), command-list recording, thin-list streams, descriptor slots, and shader translation are unchanged from
main.Switches Added (All Off by Default)
LEONIDA_TARGET_BARRIERS=<bits>(leonida-gpu/src/list/groups.rs,list.rs,list/thin.rs,draw.rs,host/place.rs; adapted aftermonte-alt/vesper7b7e556VESPER_SMART_BARRIERS, GPL-3.0):1(named texture moves): parses the console'sID3D12GraphicsCommandList7::Barriertexture barrier groups (list.rspreviously ignored_groupsand emitted one null-resource UAV barrier) and transitions named single-subresource host textures left for reading (RENDER_TARGET/DEPTH_WRITE/COPY_DEST-> shader-read / copy-source state) throughHostList::ensure_state, caching the single-subresource check (GetDesc+CheckFeatureSupport) perHostTexture::serialso partial barriers do not query the driver repeatedly. Capped at 31 textures per call with a once-logged warning; when bit2is also enabled (=3), calls exceeding 31 textures fall back to a full target wait for the remainder.2(target waits): upgrades resource-less texture barriers, global barriers, and pipeline syncs toHostList::wait_for_everything(wait_for_all) when the host list has recorded a draw, clear, or resolve into a target since its last target wait.LEONIDA_THIN=1record/replay round-trips while keeping the unset thin-list encoding identical tomain(single word) and supports live toggling viaLEONIDA_AB=4,LEONIDA_TARGET_BARRIERS.LEONIDA_LIST_TWIN_MOVE=1(leonida-gpu/src/descriptor.rs,descriptor/host.rs,descriptor/host/listed_raw_tests.rs; aftermonte-alt/vesper7b7e556, GPL-3.0):move_rawin place to non-16-byte-aligned raw buffer twins inside per-threadLIST_VIEWSslots (wheremainonly moved the single staging slot and left per-list raw twins biased or null), and adds the moved-in-list count to the raw-twins frame diagnostic line. Supports live toggling viaLEONIDA_AB=4,LEONIDA_LIST_TWIN_MOVE.LEONIDA_HOST_WAVE32=1(leonida-shader/src/emit/mod.rs,emit/lower.rs; aftermonte-alt/vesper7b7e556VESPER_RDNA_WAVE32, GPL-3.0):32..64wave lanes), tells the shader translator to target 32-lane waves (matching the wave-32 forms run on NVIDIA) and keys the shader cache on both the effective lane count and switch value."no wave32 lowering for this wave64 program"(emit/mod.rs), so missing pipelines / skipped draws are expected on aLEONIDA_HOST_WAVE32=1run. Do not read unrelated missing geometry or passes as #2771/#2770 getting worse — judge only whether the flickering black/grey ground tiles themselves disappear or change.d3d12/docs/switches.md: Regenerated viapython -I tools/d3d12_switches.py --out d3d12/docs/switches.md.A/B Isolation Plan for RDNA 3 / RDNA 4 (#2771, #2770)
From the same outdoor save spot through the launcher (
diagprofile):Useful existing zero-code controls on the same spot if needed:
LEONIDA_INDIRECT_BATCH='0'; LEONIDA_INDIRECT_WINDOW='0',LEONIDA_RAW_VIEWS='0', andLEONIDA_TWIN_BIAS='0'.Key log lines to include from each run:
host wave lanesthe title's waits for what was drawn into targets per frame ...(reports full target waits, skipped waits, named read textures, and in-list transitions)raw twins of buffer views made per frame ...LEONIDA_HOST_WAVE32=1: ...plus"no wave32 lowering for this wave64 program"/DROPPED/no host pipelinelines (onLEONIDA_HOST_WAVE32=1, wave64-only shader refusals and missing pipelines are expected)Once a reporter confirms which switch resolves the outdoor ground tiles (and its frame-time delta), flipping that default is a one-line follow-up.
Verification & AI Disclosure
go, risk0/4), Claude Opus 5.5 (4 adversarial review passes), and Gemini 4 Neon (opus-systems-criticreview on the follow-up cache/counter/test commit).10.0.26200), NVIDIA GeForce RTX 3090 (24 GB, driver610.88) and D3D12 WARP (LEONIDA_D3D12_WARP=1):cargo test -p leonida-gpu --lib(default,--features diagnostics, andLEONIDA_D3D12_WARP=1): all passing, including 16 new hardware/WARP tests acrosslist::groups(including cachedone_subresourcequery count verification),list::thin, anddescriptor::host::listed_raw_tests(including fresh-threadmake_listed->LIST_SLOTS->own_slotverification on hardware and WARP).cargo test -p leonida-shader --lib(default and--features diagnostics):404passed,0failed (includingemit::tests::a_card_with_waves_of_32_to_64_is_taken_for_one_of_32_only_when_asked).cargo clippy --all-targets(0warnings on added lines),python -I tools/d3d12_switches.py --check d3d12/docs/switches.md(rc=0),tests/test_docs_*.py(rc=0),python -I scripts/check_no_game_data.py(rc=0).listed_twins_moved_readbackremains#[ignore]d locally becauseheap.raw == 0on RTX 3090 / WARP), andID3D12Debuglayer barrier validation (d3d12SDKLayers.dll/ Windows Graphics Tools is not installed on this machine).Verified on Windows with the three code commits and without the fourth, which is documentation and conflicts on its own. The workspace is green apart from the asset policy that
mainalready fails.main10bed9ff2(this branch's merge base),cargo 1.98.1:That remaining failure is
mainfailing its own asset policy on two source files over 640 KiB - not this diff; #2815 fixes it.So the 1,567 lines of code across
list/groups.rs(1,096 new),list.rs,list/thin.rs,host/place.rs,emit/mod.rsandemit/lower.rscompile and pass every test in the workspace. The 12 lines this does not cover are thedocs/switches.mdrow for three new switches, and the conflict there is the switches table's usual one.What I could not test: what the switches do.
LEONIDA_TARGET_BARRIERS,LEONIDA_LIST_TWIN_MOVEandLEONIDA_HOST_WAVE32need a title driving an RDNA card - this machine has a 4090, and the wave32 switch is for a card this is not. The suite passes; the behaviour those switches ask for is what its author measured and I cannot.One thing worth saying about the shape: three switches and 1,096 new lines in one file is a lot to review, and the split this branch already has - one commit per switch plus the doc row - is the right one. If it is rebased, keep that split: the doc commit is what needs the rerere, and the code is what a reviewer should read.
AI-assisted: yes - DeepSeek v4.1 (flash), a 6.9-minute workspace run on the three-commit tree.
Written with an AI assistant.
Thanks for the thorough review @KelboLive (and @fiestorra for the full-workspace run)! Pushed
6f7d5910cand updated the PR description to address all three items and both nits:LEONIDA_HOST_WAVE32=1refusal guidance: Updated both the switch summary and A/B run notes in the PR description to name"no wave32 lowering for this wave64 program"(leonida-shader/src/emit/mod.rs) explicitly and state that refused wave64-only shaders / missing pipelines are expected on=1, so testers evaluate only whether the ground tiles themselves change rather than treating unrelated missing draws as a regression.one_subresourcecached per host texture (list.rs): Added a lock-free 4,096-slot[AtomicU64; 4096]cache keyed byHostTexture::serial((serial << 2) | (1 + one)) soGetDesc+CheckFeatureSupport(D3D12_FEATURE_FORMAT_INFO)runs at most once perHostTexture(absent rare hash eviction) instead of on every partial barrier, covered by a query-count assertion inlist::groups::tests::a_barrier_on_a_part_of_a_texture_moves_it_only_if_that_is_all_of_it.make_listed->LIST_SLOTS->own_slottest (descriptor/host/listed_raw_tests.rs): Added un-ignoredmake_listed_populates_thread_list_slots_for_own_slot, which spawns a fresh worker thread (LIST_SLOTS == (0, 0)), callsheap.make_listed(...)on a real registered placed buffer view, verifiesLIST_SLOTSmatchesLIST_VIEWS's[start, end)range, and checksown_slotacross interior, boundary, and staging handles on both hardware (RTX 3090) andLEONIDA_D3D12_WARP=1.draw.rs+ PR body): Clarified in the PR body that the>31-texture fallback wait applies when bit2is enabled (=3), and addedTARGET_WAITS[3](ensure_state_moved) so the frame log reports both{named} host textures named for readingand({inline} transitioned in the list, the rest at submission or already in state).AI-assisted: authored with Gemini 4 Carbon; independently reviewed with Gemini 4 Neon (
opus-systems-critic). Tested on Windows 11, RTX 3090 (driver 610.88) +LEONIDA_D3D12_WARP=1.I ran two-vendor barrier and descriptor checks at 6e1b7eb3 against 88a9f133e. The Rust tree auto-merges. The only unresolved path is d3d12/docs/switches.md, so this is coverage of the merged Rust code. Win64 MSVC target, Wine 11.22 and VKD3D-Proton 3.1.0, Radeon Raphael RADV 26.3.1 and RTX 4070 SUPER 620.73.04.
Each GPU passed 18 tests across list::groups, the enhanced-barrier round trip and the listed descriptor tests. Each also passed the 26 paired-wave and twin-bias shader tests. The off-by-default wave-limit selector test passed separately. The two ignored raw-twin readbacks, when explicitly run, both stopped at the prerequisite that a raw-twin heap be available.
To exercise the readbacks, I made a local build with only the test heap sizes reduced (raw twin base 2^18 and dynamic minimum 2^15). All six listed-descriptor tests then passed on each GPU. The two readbacks returned the expected values with the switch both off and on. Both drivers retained a bias in the on arm because their descriptor layouts do not satisfy move_raw, so that part verifies fallback readback only. The test with synthetic descriptors separately covers an actual move. No RDNA3/RDNA4 terrain-repro claim. MEASURED with synthetic tests. AI-assisted (Codex).
Barrier and descriptor recheck after the main merge at
f34bcd57on60f7dcd9, using Wine 11.22 / VKD3D-Proton 3.1.0. On RTX 4070 SUPER (620.73.4) and Radeon (RADV 26.3.1), the stock barrier, thin-list and listed-descriptor selection passed 22 tests per GPU with three ignored. The same selection on main passed six per GPU with two ignored. The separate Wave32 selector unit test passed.Both optional GPU readbacks stopped at the raw-twin heap prerequisite with stock limits. With just the local heap constants reduced for the test hosts, both passed on each GPU. Listed-twin and public transfers returned expected data at the three source/target bias pairs (4/12, 8/8, 12/4). Both drivers retained the bias when relocation was requested. The moved case is covered here by the stock synthetic descriptor test.
MEASURED with synthetic buffers and shader fixtures. AI-assisted (Codex).
Native Windows AMD complement: RDNA4 through AMD's own D3D12 driver. The runs above are RTX 4090, RTX 3090, WARP, RTX 4070 SUPER and RADV under Wine; none is the native D3D12 driver that #2770 / #2771 run on.
Radeon RX 9060 XT (RDNA4, 16 GB), driver 32.0.23033.1002, Windows 10 Pro 22H2 19045.7846, rustc 1.100.1. Head
f34bcd57bmerged (no commit) intomain913b88b90, merges cleanly.cargo test(whole workspace), 2 runs each. MEASURED.mainalone: 755 passed, 1 failed,depth_bounds_pipeline_loads_and_filters_draws(Windows 10's in-box D3D12, #2855).LEONIDA_TARGET_BARRIERS=7 LEONIDA_LIST_TWIN_MOVE=1 LEONIDA_HOST_WAVE32=1: 773 passed, 2 failed. The extra one isdescriptor::host::listed_raw_tests::sub_dword_views_null_twins_and_recycled_raw_cbv_clears_bias.That extra failure is the test, which does not pin the switch it checks. That test alone, one switch at a time, 3 runs each. MEASURED.
LEONIDA_TARGET_BARRIERS=7,LEONIDA_HOST_WAVE32=1: pass 3/3.LEONIDA_LIST_TWIN_MOVE=1: fails 3/3 atlisted_raw_tests.rs:464,non-dword-aligned SRV twin (by=2) must be null, not reading misaligned pre-view bytes.--features diagnostics,LEONIDA_D3D12_WARP=1), the same head passes 3/3 with the switch at 1. ASSUMED: the test leaves early there, since this PR's description saysheap.raw == 0on WARP. So the red only shows wheremove_rawreally moves the twin, which is the case on this AMD card.settle_twin(host.rs:5473) takesown_slot(host.rs:5461), thenmove_raw(host.rs:5501). By designmove_rawalso moves off-dword twins: "Off dwords too",host.rs:5502. The test does not pin the switch, unlikelisted_readback, which sets it withTwinMove::set(listed_raw_tests.rs:61). So a tester on an AMD card who exportsLEONIDA_LIST_TWIN_MOVE=1for the #2770 A/B and then runscargo testgets a red that says nothing about the card.fix-2834-twin-test-pin, one commit on this head. It addslet _moved = TwinMove::set(false);at the top of that test. MEASURED on the RX 9060 XT, 3 runs each: passes with the switch at 0 and at 1. The wholeleonida-gpucrate with the switch at 1: onlydepth_boundsfails, 2 runs.The ignored hardware probes. On the RX 9060 XT, 3 runs each, MEASURED:
listed_twins_moved_readback -- --ignored: passes 3/3. The probe sets the switch on itself.listed_off_alignment_raw_twin_readback -- --ignored: passes 3/3. This one sets it off.Each prints "listed twins read right" (moved to their views: true for the first, false for the second), "public transfer correct, existing layout guard SRV=true UAV=true", for source bias 4 / target 12, 8 / 8 and 12 / 4.
So on RDNA4's native driver, list twins read correctly for dword-aligned biases, moved or not. Neither probe has an off-dword case (by = 2, 6, ...). That is the case the switch now moves too, and whether RDNA reads it right is not covered by these runs. It would be worth a case before reading the #2770 A/B. ASSUMED.
Part of these numbers was recomputed by a second agent on the same machine: the log counts, the line references, the pin fix, and the WARP run that corrected an earlier draft of this comment. AI-assisted: yes (Claude Code).
Thanks for running both
#[ignore]d hardware readback probes on a native Windows RDNA 4 RX 9060 XT @Tauwni — great to have direct confirmation thatmove_rawengages (moved to their views: true,SRV=true UAV=true) and passes3/3on RDNA 4! Foldedlet _moved = TwinMove::set(false);at the top ofsub_dword_views_null_twins_and_recycled_raw_cbv_clears_biasinb20fd5bb6(and syncedswitches.mdontomain) so runningcargo testwithLEONIDA_LIST_TWIN_MOVE=1exported in the environment stays clean on AMD cards.AI-assisted: Gemini 4 Carbon.
This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).
Could you, or anyone with a working setup, post a run report on the current head merged onto current
main:mainSHA it was merged onto;mainalone for comparison, if you can.Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.
AI-assisted (Claude Code).
Ran natively on Windows 11, head
0386100f0merged into currentmain(43fc605ed, merges cleanly),--features diagnostics, on an NVIDIA card and on WARP, with the D3D12 debug layer this time. The head has since moved to01df1490c, a merge ofmainat5b1fff821with the PR's own diff unchanged. On that head I re-ran the gpu suite, the PR tests under the debug layer, and the all-switches suite (bottom of the tables). The earlier runs here had no debug layer on Windows (the PR body says it was not installed) or ran under Wine, so the barrier recording had not been through the native debug layer yet.Suites on the merge. MEASURED.
leonida-gpu --lib, cardleonida-gpu --lib, WARPleonida-shader --libclippy --all-targets(gpu + shader)leonida-gpu --lib, card and WARP, new head01df1490cDebug layer, PR tests.
list::groups,list::thinanddescriptor::host::listed_raw_tests, withLEONIDA_D3D12_DEBUG=1. The groups tests'run()closes and executes what they record and asserts the debug layer logged nothing. I confirmed the layer was attached: a throwaway test that records a deliberately wrong barrier stops at once with the debug layer'sResourceBarriererror. MEASURED.LEONIDA_D3D12_GBV=101df1490cThe barrier-move and target-wait paths (bits 1, 2 and 3, the thin round trip, clears and resolves) record nothing the debug layer rejects, on either device.
Whole gpu suite with all three switches set.
LEONIDA_TARGET_BARRIERS=3 LEONIDA_LIST_TWIN_MOVE=1 LEONIDA_HOST_WAVE32=1 LEONIDA_D3D12_DEBUG=1. MEASURED.leonida-gpu --lib01df1490c, 3 runs eachOn the new head, one run on each device had a single red, and each was a different test:
indirect::tests::host_list_window_executions_need_no_barrier_of_their_ownon the card andtimeline::report::tests::real_waits_are_recorded_with_who_ended_themon WARP. Both passed when rerun, and the indirect one passed 3/3 alone with each switch set on its own and with all three. I read them as load-sensitive tests on a busy machine, not as an effect of the switches.On these two devices only the barrier switch really does anything.
LEONIDA_HOST_WAVE32needs an AMD card (told_lanesreturns the real lanes otherwise).LEONIDA_LIST_TWIN_MOVEonly acts wheremove_rawtakes the descriptors, anddump_buffer_view_descriptor_bytesprintsmove_raw would take: SRV false UAV falseon this card. The two ignored readbacks stop at "the host must allocate raw twins", as reported above. So this run is no evidence about those two switches on AMD.Switches unset compared with
main. MEASURED except where marked.TEST_BITS):words()for 0, 1, 2, 30, 31, 32, 33, 100 and 1000 barriers, null and named texture, count 0 and 1[count], one word as onmaintargets_written, pipeline sync, 4 rounds, cardown_slotfor addresses inside this thread'sLIST_SLOTSNone, sosettle_twintakesmain's pathemit::emitresult in the 39leonida-shadertests that reach it, one thread,mainagainst this mergeTEST_HOST_WAVE, which returns before the changed line inhost_max_wave, so the unpinned path is covered mainly by readingtold_lanesOne thing that does change with the switches unset (READ IN CODE).
clear_rtv,clear_dsvandresolvenow always callwith_state(this, |_, state| state.targets_written()). In a diagnostics build that is one more state lock, atick()and onecopystat"list call" for each clear and resolve, whatever the switch says. The recorded host commands are unchanged, but the "list calls per frame" figure of a diagnostics run moves a little againstmain. Agroups::waits()check before it would keep the unset path as it was.Switch values. READ IN CODE, and the PR's own
the_switch_is_off_unless_it_is_a_numbercovers the first row.LEONIDA_TARGET_BARRIERSu8masked to its low two bits, trimmed7acts as3,4and256as off; a log line says what the value was taken asLEONIDA_LIST_TWIN_MOVE0(switch::on)falseoroffturns it on; that is the crate's conventionLEONIDA_HOST_WAVE321true,yesor1leave it off and print nothing, since the log line only comes when it is onWith
LEONIDA_ABnamingLEONIDA_TARGET_BARRIERS, the AB bit wins and alternates 3 and 0. A value such asLEONIDA_TARGET_BARRIERS=1set alongside it is then ignored, with no log line. That matters for the A/B plan, which suggests trying1and2on their own after3.Overlap with #3136.
git merge-treeof the two heads conflicts inleonida-gpu/src/list.rs. #3136 giveswith_statean op-name argument, and this PR adds new two-argumentwith_statecalls (targets_written,wait). Whichever lands second needs a rebase, and its newwith_statecalls need the op name.Not checked: any AMD card, so the two AMD-only switches did nothing here; an in-game run (the collaborator's gate above still stands); the ignored raw-twin readbacks beyond their prerequisite; the frame-time cost of bit 2.
GPUs tested: one NVIDIA desktop card + WARP.
AI-assisted: yes (Claude Code).
Triage of head
01df1490c(merge base5b1fff821, 3 commits behind;git merge-treeagainst currentmain45dc41f95: no conflicts).11 files (+1,703/-47), mostly new
list/groups.rs(+1,110), all behind opt-in switches.CI green on the head (6 checks).
Existing verification: Verified by @fiestorra, @merzleckeier (RADV and RTX under Wine), @Tauwni (native RDNA 4 RX 9060 XT) and @Kal0s-design on
0386100f0with the debug layer. The current head01df1490cis a merge ofmainplus a regeneratedswitches.md; the PR's own diff is unchanged.This check: Not re-reviewed in depth. The switches are off by default, so default behaviour is unchanged; the body states the RDNA 3/4 root cause is not proven. The size (+1,110 lines in one new file) is the main review risk; the issues it is for (#2770, #2771) still need an A/B on the reporting hardware.
I did not build it: the crate is Windows-only (or the C++ runtime's Windows build), so no red/green was run here.
Verdict: ready (opt-in only, verified on four configurations; root cause still open by design).
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
Merged
origin/main(516c9eaabf) intoc60eaf13dfstrictly to regenerated3d12/docs/switches.md(needs rebase); all 10 Rust files (descriptor.rs,descriptor/host.rs,draw.rs,listed_raw_tests.rs,host/place.rs,list.rs,list/groups.rs,list/thin.rs,emit/lower.rs, andemit/mod.rs) preserve 100% identical+/-changes againstorigin/maincompared to01df1490c4.AI-assisted: Gemini 4 Carbon (High) and Gemini 4 Neon (XHigh).
RUN (in game, one pull request), its head merged with
git merge --no-ffonto main516c9eaab: #2834c60eaf13d. RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x,-PrecompileUsed, the same walking route as the other runs on this machine, 330 s after reaching the world.For reference, the same machine and route rendered 13.3 to 17.2 fps on other batches in the last day. These fps are a check that nothing fell over, not a measurement of a gain.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this pull request, on the head above. If it changes its head, this run no longer covers it.
Limits: one run; arrival in the world was driven by keys and not checked on pictures;
-PrecompileUsedwas used, so the default start (every known pipeline precompiled) was not exercised. It was run alone because it does not merge together with #2789 and #3072. Its switches are opt-in and target RDNA; they were left off on this NVIDIA card, so this run covers the default path only. The precompile before the world took 528 s against about 155 s for the batches before it: something in this head changes pipelines and leaves the cache cold (cause not looked into).AI-assisted (Claude Code).
Merged
origin/main(6e97990505,#3318) into6a0a20c7f1strictly to regenerated3d12/docs/switches.md(needs rebase); all 10 Rust files have byte-identical diffs againstorigin/maincompared toc60eaf13df.AI-assisted: Gemini 4 Carbon (High) and Gemini 4 Neon (XHigh).