Tests: a harness for barrier states across submission orders #3559
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3559"
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?
Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-01T04:44:40Z.
Part A of the plan announced on #3094 (7298369429): resolving barrier states at submission instead of in recording order. This part is test-only: the harness the later parts' regressions use, with the cases that already hold on
main.A recording is a stand-in PC list that keeps the words XCL's hooks send its
ResourceBarrier(a title's legacy barriers throughlist_x::resource_barrier_x, its enhanced barriers throughlist_x::uav_barrier_x). A CPU model of the GPU runs recordings in a chosen submission order and reports each transition whose before-state is not the state the texture is in at that point: what the debug layer reports as 527 / 538. The debug layer itself is not used, because it is one per process and turning it on would remove the devices of the tests running beside these (gpu::agility::enable_debug_layer). The textures are WARP resources (barrier_groupsreads their descriptions); nothing runs on the GPU, and without a WARP device the tests are skipped.The cases that do not hold on
main(a list recorded before another but submitted after it, thehollowedone's discriminator; a list reset unsubmitted; KickoffX segments) come with the change that makes them hold, so that every test here passes. One thing the harness showed on the way: a texture whose first move is a legacy barrier is not tracked bybarrier_groups(note_legacy_stateonly follows tracked textures; #3489), so the cases here start each texture with an enhanced barrier that names its layout.Related: #3094, #3489
@thehollowedone, you offered to review the harness and its source: thank you. The case you named (B recorded while its texture is in the old state, A submitted before B, B's barriers corrected at submission) is the first of the red cases that come with part C.
What is in it (one commit)
crates/xcl/src/hle/d3d12x/submit_order_tests.rs(new, test-only):Recording(a stand-in list),Gpu(the model), and four tests:the_gpu_model_reports_a_before_state_the_texture_is_not_in,lists_submitted_in_their_recording_order_start_where_the_one_before_left_off,a_list_submitted_again_that_ends_where_it_starts_finds_its_states,compute_lists_submitted_in_their_recording_order_find_their_states.crates/xcl/src/hle/d3d12x/mod.rs:#[cfg(test)] mod submit_order_tests;(two lines; no runtime change).Tested
b911d16c:submit_order_tests:the_gpu_model_reports_a_before_state_the_texture_is_not_in,lists_submitted_in_their_recording_order_start_where_the_one_before_left_off,a_list_submitted_again_that_ends_where_it_starts_finds_its_states,compute_lists_submitted_in_their_recording_order_find_their_states,an_unanswered_slot_is_recorded_not_a_crash): 5 passed, 0 failed (also on an RTX 5090 machine, MSVC, debug).cargo test --workspace --no-fail-fast -- --test-threads=4(leaving out the 3uma_drivertests that need a GPU upload segment this VM does not have): 2886 passed, 6 failed, 51 ignored; 28SKIPPED(the VM's usual: no wave64, no heap windows, and others). Four failures are this VM's onmaintoo (stream_recheck_keeps_the_whole_upload_baseline_over_partial_uploads,stream_recheck_partial_upload_without_an_entry_queues_a_whole_upload,stream_recheck_schedule_catches_late_writes_and_resets_milestones,test_title_runs_and_game_folder_is_untouched). The other two,gpu_scale_args_reports_uncapped_group_count_feedbackandplaced_title_textures_share_vram_and_preserve_pixels, passed when run alone, on this head and onmaind0832e61(1 passed, 0 failed each): failures of the parallel run on this VM, not of this diff, which touches only its own test module.Regression run
None: the diff is test-only (a new test module and its
#[cfg(test)]line inmod.rs), so the runtime is unchanged; a maintainer may apply thetest-onlylabel.Not tested
main(they come with the change, parts B and C).AI use
🤖 Generated with Claude Code
https://claude.ai/code/session_013oPUFCA9W9F8Qb5MPK33bR
Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-01T04:45:33Z.
The only change outside the new test file is the
#[cfg(test)] mod submit_order_tests;declaration inhle/d3d12x/mod.rs, soPR checkscounts it as a runtime change. Could a maintainer apply thetest-onlylabel after looking at the diff?AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:07:08Z.
Review (head
6e1a5ce4, diff read, not a merge-check; draft, test-only):submit_order_tests.rs~59-64) fills only GetType and ResourceBarrier and leaves every other slot at 0. If a path underresource_barrier_xever calls another PC function (e.g. the depth-twin CopyTextureRegion copies for a kept depth buffer), the whole lib test binary takes an access violation instead of one test failing. Filling the unused slots with a function that panics would keep a failure local.PR descriptionfails without smoke blocks; the diff is test-only (a#[cfg(test)]module), so it needs thetest-onlylabel.Fine: it drives the real
uav_barrier_x->barrier_groups::transitions->resource_barrier_xpath throughreal::orig_fnwith slots 8 and 26 right (only the GPU state check is modelled), it skips without WARP or withXCL_BARRIER_GROUPS=0, and CI ran all four tests.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-01T08:36:49Z.
@Foniass thanks: done in the PR's one commit, now
51929d1c. Every slot of the stand-in's two tables that it does not answer holds its own small function, which records its slot number on the recording and returns 0; dropping a recording with a recorded call fails that test and names the slots. Not a panicking function: a panic cannot unwind out of anextern "system"call, so it would abort the whole test binary just as the jump to address 0 did. A new test,an_unanswered_slot_is_recorded_not_a_crash, calls slot 12 and checks it is recorded. Harness tests: 5 passed (local, RTX 5090 machine); the whole suite on this head is running and goes into the description.AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:46:12Z.
Re-review (head
51929d1c, diff read, not a merge-check;PR descriptionred, test-only). Follow-up to my review of6e1a5ce4.extern "system"call.an_unanswered_slot_is_recorded_not_a_crashchecks it.ID3D12GraphicsCommandListslot (DispatchMesh 78, the enhancedBarrier79) would still read past them. Nothing underresource_barrier_xmakes one today.6e1a5ce4and four tests; this head has five. Your comment says the suite run on this head is going in.test-onlylabel forPR description.Fine: the model's checks are explicit asserts. They would catch a break in the legacy-to-
LASTsync, in the move out of the undefined layout, or in the compute-list legalisation that strips 0x80. It runs on WARP, so no-GPU CI covers it.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-01T08:49:18Z.
@Foniass thanks: both tables are now 128 slots (past DispatchMesh 78 and the enhanced
Barrier79), and the test's doc comment keeps only the reason. Headb911d16c; Tested gets this head, the five harness tests and the suite counts when its run lands.AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:54:22Z.
Re-review (head
b911d16c; the diff from51929d1c, 4 lines). Both nits are addressed: the two tables now have 128 slots each, past DispatchMesh (78) and the enhanced Barrier (79), and the new test's doc comment states its reason. Still open from my last comment: the Tested section on this head, and thetest-onlylabel.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T10:16:13Z.
Triage (#1607) – head
b911d16No open or merged PR adds this harness. It is test-only: a new
submit_order_tests.rsand a#[cfg(test)]line inmod.rs. It is part A of the plan from #3094, and #3558 by the same author is related but separate.Nits: the comment on the stand-in table says DispatchMesh is slot 78 and Barrier 79, but they are 79 and 80 (
d3d12_layout.rs). The WARP textures are not adopted, sobarrier_groups::forgetnever runs for them, and theirLASTentries outlive the test inside a shared test process.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.