Repository navigation
D3D12.X: canonicalize inactive two-pass stream descriptors - #2448
Conversation
|
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
…#2127, xcl-dev#2476, xcl-dev#2479, xcl-dev#2467, xcl-dev#2444, xcl-dev#2447, xcl-dev#2448 Integrates compositor RT tracking fix (xcl-dev#2480), split shader cache budget (xcl-dev#2475), foreign-thread deferred release (xcl-dev#2474), Wine 4-thread DXC cap (xcl-dev#2127), DXIL feature/reload fixes (xcl-dev#2476, xcl-dev#2479), DXC loader cleanup (xcl-dev#2467), console xcl-dev#14 null ppv guard (xcl-dev#2444), root-sig flag stripping (xcl-dev#2447), and two-pass stream canonicalization (xcl-dev#2448). Assisted-by: Antigravity (Gemini 4 Neon)
bmjask
left a comment
There was a problem hiding this comment.
No concrete correctness defect found. Inactive descriptor canonicalization keys semantic count/flags rather than pointers/padding while retaining active/duplicate/unknown rejection; current Windows CI is green. This runtime change is not merge-ready because paired retail smoke runs are explicitly pending and description checks fail. Nonblocking coverage gap: regression uses only zero-length VS; broader optional-stage cases would strengthen it.
Zero-count stream output, input layouts, and view instancing can carry inert pointer values and padding. Treat them and empty optional shader bytecode as omitted so the stream remains eligible for a stable two-pass cache key. Preserve rejection of unsupported active state. Assisted-by: Codex (GPT-6)
01cb489 to
d61ffdc
Compare
…ject (port upstream xcl-dev#2448 + xcl-dev#2693)
|
Tested on \d61ffdc435d5b7c71f4635e4fb06b28eed1328a3\ (\d61ffdc4, clean PR head):
Not tested
AI use
|
|
@bmjask The rebased head is The RTX 4060 Laptop full-suite rerun passed 1,436 with 0 failures, 47 ignores, and 26 runtime skip markers. The initial asynchronous dispatch assertion passed in isolation on clean main and this head, and passed in both full suites on rerun. The paired retail smoke recorded 620 frames against main's 560, peak commit 15,263 MB against 14,812 MB, and zero crashes or device removals. Both unedited blocks are in the description. |
Prime1997
left a comment
There was a problem hiding this comment.
Read-through and test run of d61ffdc. An AI tool (Claude Code) helped with the reading and ran the tests; each point below was checked against the code at this head.
Test results (RTX 3060 Ti 8 GB, NVIDIA 617.14 / 32.0.16.1714, i5-10400, Windows 11 26200.9974, rustc 1.100.0, DXC 1.9.2609.5, debug): the focused test command from the description gives 5 passed, 0 failed. To be clear about what that shows: those five tests are CPU-only. They never create a device, so this is not a GPU validation of the change, only confirmation that the key logic behaves as the tests describe on this toolchain. The stream tests that do create a device also pass at this head: --lib mesh_stream 3 passed, 0 failed, and --test d3d12_mesh_stream 3 passed, 0 failed.
Points for the author
- A shader entry with
BytecodeLength == 0(and type other than 25) is skipped withcontinue, so it is keyed the same as an omitted entry whatever its pointer is. The description says so, andempty_stream_descriptors_do_not_change_the_keypins it for seven stages with a non-null pointer and for the refused empty MS. I think that is the right call. - The new fail-closed conditions (NumEntries, NumStrides, RasterizedStream, ViewInstanceCount, Flags) have no negative tests. One test per condition showing the key is refused would protect them from a later refactor.
- I found no change to the key of any descriptor that was already accepted, which matches the description.
- Nothing on main calls
two_pass_stream_keyyet. The change only takes effect together with #1942 (or on the nvidia-dev line), so it would help reviewers if the description said which order the two are meant to land in.
Low risk as it stands. Point 2 is a test gap rather than a defect.
Generated by Claude Code
gsucristo
left a comment
There was a problem hiding this comment.
Reviewed d61ffdc4 (crates/xcl/src/hle/d3d12x/real/two_pass_identity.rs). Looks clean and sound:
- Inactive descriptor canonicalization: Checking
NumEntries/NumStrides/RasterizedStreamforD3D12_STREAM_OUTPUT_DESC(7),NumElementsforD3D12_INPUT_LAYOUT_DESC(12), andViewInstanceCount/FlagsforD3D12_VIEW_INSTANCING_DESC(22) covers every semantic non-pointer field of those structs while ignoring inert pointers and struct padding. Active counts/flags still fail closed even when the accompanying pointer is null. - Empty optional shader stages: Skipping
BytecodeLength == 0whenty != 25makes empty optional stages canonicalize identically to omitted stages regardless ofpShaderBytecode, while an empty requiredMS(25) or any non-zeroBytecodeLengthwith a null/unreadable pointer still fails closed viapayload_shader. - Invariants & cache compatibility: Duplicate-subobject and stream-length checks still run before the match loop, and previously accepted streams produce the exact same key, so no
TWO_PASS_CACHE_SCHEMAbump is needed. - Test coverage:
empty_stream_descriptors_do_not_change_the_keycovers all three inactive descriptors (including dirtyINPUT_LAYOUTtrailing padding), all seven optional shader stages with non-null pointers, and the rejected emptyMS. Non-blocking: adding negative cases for the newly splitSTREAM_OUTPUTandVIEW_INSTANCINGnon-zero count/flag conditions (especially with null pointers) would further lock down the fail-closed paths, as also noted above.
LGTM.
|
@gsucristo @Prime1997 Thanks for the reviews. #2448 can land before #1942. Additional negative tests for active descriptor fields would strengthen coverage without changing the existing cache schema. |
Canonicalize inactive two-pass stream descriptors when building the mesh pipeline cache identity. Empty optional shader bytecode contributes the same key as an omitted stage. Active unsupported state, duplicates, and malformed streams still fail closed.
What is in it
crates/xcl/src/hle/d3d12x/real/two_pass_identity.rsignores inert pointers and padding on inactive stream-output, input-layout and view-instancing descriptors.Tested
d61ffdc435d5b7c71f4635e4fb06b28eed1328a3on Windows 11 build 26200.9974, Ryzen 7 8845HS, NVIDIA GeForce RTX 4060 Laptop GPU (616.56), Rust 1.98.1 MSVC, debug.cargo test --offline --locked -p xcl --lib two_pass_identity -- --nocapture --test-threads=1passed 5 tests with zero failures, ignores or runtime skips.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-output. There were 26 explicit GPU skip markers (21 no native wave64, 3 refused wave32 per-lane operation, 1 Windows Developer Mode unavailable, 1 no heap windows). Clean main atb49be183passed 1,435 with 0 failures, 47 ignores, and 26 runtime skip markers.Regression run
Clean release builds on the same RTX 4060 Laptop GPU and retail workload. XCL used a separate title state and DXIL cache for each run.
Main
PR head
Not tested
AI use
OpenAI Codex (gpt-6.2-sol) rebased, expanded coverage, ran tests, and prepared this description.