Repository navigation
Conversation
…natively barrier_groups turns a title's enhanced barrier from the undefined layout into a legacy transition whose before-state is the last state it recorded for the texture (LAST), in the order the title RECORDS its lists. The GPU runs the lists in the order they are SUBMITTED, so a title that records on several threads gets before-states the texture is not in (the debug layer's errors 527/538); what the GPU then does is undefined. A barrier with a layout before it names its own state, so these moves are the only place barrier_groups depends on recording order. XCL_BARRIER_UNDEFINED_NATIVE=1 (default off) sends them as enhanced texture barriers with LayoutBefore UNDEFINED, which need no before-state. They carry a FROM_UNDEFINED mark that only barrier_groups' own call passes through resource_barrier_x's flag filter (a thread-local scope). A marked move is made even when the last state is unknown or already the target, and is kept where a legacy one would be a no-op (resource_barrier_x, depth_uav's parking); without enhanced barriers, or for a state with no single layout, the run goes out as before with the mark off and such moves left out. Tests: a_barrier_from_undefined_starts_from_the_state_in_submission_order records two lists out of order and shows the legacy before-state is the recording-order one (after thehollowedone's two-list regression on xcl-dev#3094); the mark, the flag filter, the scope and the kept moves have their own. Related: xcl-dev#3489, xcl-dev#3094 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Source review on head Please carry the title's before-sync scope into the native barrier, or conservatively use This is a source and API-contract finding. I have not run the opt-in path on a GPU or title. AI use: Codex (GPT-6.2 Sol) and Codex (GPT-6.2 Astra) traced the path against Microsoft's specification. |
|
Source review on head Microsoft's enhanced-barrier interop contract requires a texture in an enhanced layout to be placed in A deterministic regression can use a fresh ordinary texture and capture the final PC calls, not only the intermediate marked words: on a direct list with enhanced barriers supported, issue AI use: Codex (GPT-6.2 Sol) checked the emitted sequence and Microsoft specification; Codex (GPT-6.2 Astra) independently checked the interop invariant. |
|
@thehollowedone thank you for both reviews; both are right on the API contract.
Rather than keep patching this opt-in path, the fixes go into the submit-time series announced on #3094 (resolving barrier states at submission): the title's before-sync carried into each barrier, one barrier model per subresource with the COMMON hand-offs placed in execution order, and XCL's own copies around title textures (depth twins, alias copies) following the same rule. Its part A (the harness for submission-order regressions, test-only) opens shortly, and your cases will be among its regressions. This PR stays a draft with its switch off until then, and will be closed in favour of that series, with credit to you, once it covers this. 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. |
|
Review (head bd888cf, diff read, not a merge-check; draft with
Fine: with the switch off the barriers sent are unchanged (one unmarked run goes to the same legacy call, plus one small Vec per call). Native barriers are gated on AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
No open PR makes the same change. #3527 also deals with barrier_groups' moves from the undefined layout (#3489), but it starts them from the texture's creation state, by default. This PR sends them as enhanced barriers from LAYOUT_UNDEFINED behind XCL_BARRIER_UNDEFINED_NATIVE=1, which also removes the dependency on recording order. These are different approaches. #3559 is the same author's test harness for that plan, not an overlap. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
|
@gut0to thanks for checking the layouts so closely; that mapping is exactly where a mistake would void every run with the switch on. I compared it against the SDK, and the values match: in AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen. |
barrier_groups(list call #146) turns a title's enhanced barrier from the undefined layout into a legacy transition whose before-state is the last state it recorded for the texture (LAST). It records those states in the order the title records its lists, but the GPU runs them in the order they are submitted. A title that records on several threads therefore gets before-states the texture is not in when the list runs (the debug layer's errors 527/538), and what the GPU does with them is undefined. thehollowedone found this first, on #3094 (point 2 and the two-list regression); imnicho's answer there is that it needs a fix outside that PR.A barrier with a layout before it names its own state, so the moves from the undefined layout are the only place
barrier_groupsdepends on recording order.XCL_BARRIER_UNDEFINED_NATIVE=1(default off) sends them as enhanced texture barriers withLayoutBefore = UNDEFINED, which need no before-state at all. With the switch on and enhanced barriers on the device,barrier_groupsno longer depends on the order lists are recorded in. A state with no single layout, or a device without enhanced barriers, goes out as before.Scope. This does not resolve states at submission. A complete fix keeps each recording's transitions private until submission and resolves them at the list's exact place in the queue's order,
KickoffXand repeat submissions included, because the barriers of a closed list cannot be rewritten atExecuteCommandLists(thehollowedone, #3094). This change only takes the moves from the undefined layout out of that dependency: they are the one placebarrier_groupsuses a before-state it recorded itself rather than one the title named.alias_copy's own record of states (#3094) keeps the same limit.Related: #3489, #3094, #3527 (seeds texture states at creation; it should land first)
Based on
main9dfbe3e (it merges into currentmainwithout conflicts): see Regression run.What is in it (one commit)
barrier_groups.rs: theFROM_UNDEFINEDmark on moves from the undefined layout when the switch is on (native_undefined),native_layout(a state's one enhanced layout and access), and a marked move made even when the last state is unknown or already the target.list_x.rs:resource_barrier_x's flag filter keeps the mark only forbarrier_groups' own call (a thread-local scope,as_groups);send_barrierssends marked runs throughID3D12GraphicsCommandList7::Barrierand falls back to legacy transitions (as_legacy: the mark off, the moves with no before-state of their own left out);a_no_opkeeps marked same-state words.depth_uav.rs:plan_withkeeps a marked move that parking turns into the same state before and after.a_barrier_from_undefined_starts_from_the_state_in_submission_order(two lists recorded out of submission order: the legacy before-state is the recording-order one; after thehollowedone's two-list regression and their discriminator on D3D12.X: a sampled texture in the memory of a written one of another format is copied from it (XCL_ALIAS_COPY=1) #3094, one recording read under two submission orders),a_native_move_from_undefined_is_kept_without_a_before_state,a_state_from_the_undefined_layout_has_one_enhanced_layout,the_from_undefined_mark_passes_the_flag_filter_only_for_barrier_groups,a_marked_move_with_no_before_state_goes_natively_or_not_at_all,a_marked_move_into_unordered_access_of_a_parked_buffer_stays. All CPU-only.Tested
cac8b6ad):test result: FAILED. 140 passed; 3 failed; 0 ignored; 0 measured; 2632 filtered out; green with it (3731d0e7):test result: ok. 143 passed; 0 failed; 0 ignored; 0 measured; 2632 filtered out(the tests ofbarrier_groups,list_x,depth_uav).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): the same commit onmaind0832e6 (42946bf8): 2888 passed, 5 failed, 51 ignored (a first run lost the lib test binary to an access violation in the parallel run; these counts are from its complete rerun);maind0832e61on the same machine: 2882 passed, 5 failed, 51 ignored. This headbd888cf7(the same commit onmain9dfbe3e): running, its counts will be added here. The same 5 fail on both (title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels, the 3title_textures::tests::stream_recheck_*,test_title_runs_and_game_folder_is_untouched). SKIPPED: 28 on both, the same tests (22 no wave64, 2 no heap windows, 3 no debug layer, 1 driver cache cannot be disabled).Regression run
Pending: one run of this head, paired with a
main9dfbe3e run of the same recipe (held Enter, 600 s, the retail title) that entered the world.maind0832e6 stays in the title's menus with held Enter on our rig (both runs of this change on it, and one ofmaind0832e6 alone; no device removal), so the pair uses 9dfbe3e.Not tested
AI use
🤖 Generated with Claude Code
https://claude.ai/code/session_013oPUFCA9W9F8Qb5MPK33bR