D3D12.X: a command signature made at a freed one's address forgets its root-changing kind #2495

Closed
tiagonleal wants to merge 1 commit from upstream-pr/2505 into main
tiagonleal commented 2026-11-25 21:01:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-25T21:01:43Z.


ROOT_SIGNATURES only inserted. If a command signature with root arguments was freed and a simple one (Dispatch, DrawIndexed) was made at the same address, every ExecuteIndirect with it and a translated pipeline was skipped, with no counter and no log. It is now noted at every creation, the way DISPATCH_SIGNATURES is (d6ff44ce). Overlaps #869 (open, conflicting, no review), which replaces ROOT_SIGNATURES altogether.

What is in it

  • bind.rs: note_root_changing_signature(sig, changes) inserts or removes; test a_command_signature_made_at_a_freed_ones_address_does_not_keep_its_kind
  • device_x.rs: create_command_signature_x notes every successful creation

Tested

  • Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 5070 Ti 16 GB (driver 617.42), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0
  • New test, before the fix (the code of this commit with the new behaviour switched off): cargo test -p xcl --lib a_command_signature_made_at: 0 passed, 1 failed. After the fix, run 5 times: 1 passed, 0 failed each time.
  • cargo build --workspace and cargo test --workspace --no-fail-fast -j 6 -- --test-threads=4, run twice: 1420 passed, 4 failed, 46 ignored both times (25 SKIPPED lines). The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3; they fail the same way on main 6d12f58a (cargo test -p xcl --lib fuzz_validate_and_gpu: 0 passed, 4 failed).

Regression run
main (6d12f58a):

xcl-smoke v1
commit: 6d12f58a229bc73889878a448c64dc3af25eeba0
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1626 (PresentX 1626)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15346 MB

this PR's head:

xcl-smoke v1
commit: fecb7c4d2c4721f3f99a83e00948091babaadb4b
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1620 (PresentX 1620)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15878 MB

Not tested

  • No title or GPU test makes a signature at a freed one's address: the test only covers the set; the device_x.rs call is not exercised by a test.
  • Whether the retail title frees and re-creates command signatures while loading: not known. No claim about world loading.
  • AMD, other drivers, Wine.

AI use

  • Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Opus 5.5, Claude Sonnet 5.5) helped developing.
<!-- greyfinch-sync:ivall/xcl:issue:5499112915 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2505). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-25T21:01:43Z. --- ROOT_SIGNATURES only inserted. If a command signature with root arguments was freed and a simple one (Dispatch, DrawIndexed) was made at the same address, every ExecuteIndirect with it and a translated pipeline was skipped, with no counter and no log. It is now noted at every creation, the way DISPATCH_SIGNATURES is (d6ff44ce). Overlaps #869 (open, conflicting, no review), which replaces ROOT_SIGNATURES altogether. **What is in it** - `bind.rs`: `note_root_changing_signature(sig, changes)` inserts or removes; test `a_command_signature_made_at_a_freed_ones_address_does_not_keep_its_kind` - `device_x.rs`: `create_command_signature_x` notes every successful creation **Tested** - Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 5070 Ti 16 GB (driver 617.42), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0 - New test, before the fix (the code of this commit with the new behaviour switched off): `cargo test -p xcl --lib a_command_signature_made_at`: 0 passed, 1 failed. After the fix, run 5 times: 1 passed, 0 failed each time. - `cargo build --workspace` and `cargo test --workspace --no-fail-fast -j 6 -- --test-threads=4`, run twice: 1420 passed, 4 failed, 46 ignored both times (25 `SKIPPED` lines). The 4 failures are `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3`; they fail the same way on `main` 6d12f58a (`cargo test -p xcl --lib fuzz_validate_and_gpu`: 0 passed, 4 failed). **Regression run** main (6d12f58a): ``` xcl-smoke v1 commit: 6d12f58a229bc73889878a448c64dc3af25eeba0 gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1626 (PresentX 1626) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15346 MB ``` this PR's head: ``` xcl-smoke v1 commit: fecb7c4d2c4721f3f99a83e00948091babaadb4b gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1620 (PresentX 1620) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15878 MB ``` **Not tested** - No title or GPU test makes a signature at a freed one's address: the test only covers the set; the `device_x.rs` call is not exercised by a test. - Whether the retail title frees and re-creates command signatures while loading: not known. No claim about world loading. - AMD, other drivers, Wine. **AI use** - Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Opus 5.5, Claude Sonnet 5.5) helped developing.
copilot-pull-request-reviewer[bot] commented 2026-11-25 21:01:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T21:01:55Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

<!-- greyfinch-sync:ivall/xcl:review:6064932764 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2505#pullrequestreview-6064932764). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-25T21:01:55Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level. An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. [Learn about Copilot code review billing](https://docs.github.com/en/copilot/concepts/agents/code-review#code-review-usage).
DavidM1911 commented 2026-11-25 22:06:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T21:14:11Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7174796234 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2505#issuecomment-7174796234). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T21:14:11Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
SlopTart commented 2026-11-25 22:06:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T21:15:39Z.


gpu_ suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.
Targeted run of a_command_signature_made_at_a_freed_ones_address_does_not_keep_its_kind: passed.

<!-- greyfinch-sync:ivall/xcl:comment:7174830613 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2505#issuecomment-7174830613). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-25T21:15:39Z. --- `gpu_` suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Targeted run of `a_command_signature_made_at_a_freed_ones_address_does_not_keep_its_kind`: passed.
emirduran707 commented 2026-11-25 22:06:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T21:42:08Z.


Independent AMD RDNA4 (native wave64) test report on exact head fecb7c4d2c4721f3f99a83e00948091babaadb4b (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1422 passed, 2 failed, 46 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused by per-lane form; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.
    • The PR's test passed: hle::d3d12x::bind::tests::a_command_signature_made_at_a_freed_ones_address_does_not_keep_its_kind.
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 seed 722 and fuzz_validate_and_gpu_3 seed 1599) are pre-existing on unmodified main on this GPU.

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: fecb7c4d2c4721f3f99a83e00948091babaadb4b
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1602 (PresentX 1602)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13964 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • D3D12 debug layer; Intel GPUs.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7175427718 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2505#issuecomment-7175427718). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-25T21:42:08Z. --- Independent AMD RDNA4 (native wave64) test report on exact head `fecb7c4d2c4721f3f99a83e00948091babaadb4b` (clean detached checkout, no local changes). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2602.17; tests debug, smoke release. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: **1422 passed, 2 failed, 46 ignored; 8 SKIPPED** (6 in `lower_dxil::tests::{f16,f32}_programs_on_the_gpu` refused by per-lane form; `heap_window_out_of_memory_falls_back_to_the_switch_form`; `pso_measurement_compiles_an_exact_synthetic_record`). All native wave64 GPU tests ran and passed. - The PR's test passed: `hle::d3d12x::bind::tests::a_command_signature_made_at_a_freed_ones_address_does_not_keep_its_kind`. - The 2 failures (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` seed 722 and `fuzz_validate_and_gpu_3` seed 1599) are pre-existing on unmodified `main` on this GPU. **Regression run** (60 s retail-title smoke, `XCL_NETWORK=0`, release) ``` xcl-smoke v1 commit: fecb7c4d2c4721f3f99a83e00948091babaadb4b gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1602 (PresentX 1602) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13964 MB ``` (Matched `main` `68a284a` baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.) **Not tested** - D3D12 debug layer; Intel GPUs. **AI use** - Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
Decodere commented 2026-11-27 03:05:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T03:05:09Z.


Independent desktop NVIDIA verification of PR #2505 at head fecb7c4d2c4721f3f99a83e00948091babaadb4b (1 commit; exact parent & merge-base: 6d12f58a229bc73889878a448c64dc3af25eeba0, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted release tests & build (fecb7c4d)

Command Result
cargo test --release -p xcl --lib a_command_signature_made_at_a_freed_ones_address_does_not_keep_its_kind -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1324 filtered out × 3 (0.00s × 3, 0 skipped)
cargo test --release -p xcl --lib hle::d3d12x::bind:: -- --test-threads=1 (3 consecutive runs) 9 passed; 0 failed; 0 ignored; 1316 filtered out × 3 (0.43s, 0.44s, 0.43s, 0 skipped)
cargo test --release -p xcl --lib hle::d3d12x::device_x:: -- --test-threads=1 (3 consecutive runs) 14 passed; 0 failed; 0 ignored; 1311 filtered out × 3 (0.34s, 0.33s, 0.34s, 0 skipped)
cargo build --release -p xcl Clean build (1m 06s, exit 0, 0 new warnings)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (6d12f58a229bc73889878a448c64dc3af25eeba0, cached baseline on the same machine):

xcl-smoke v1
commit: 6d12f58a229bc73889878a448c64dc3af25eeba0
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1606 (PresentX 1606)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14004 MB

PR #2505 (fecb7c4d2c4721f3f99a83e00948091babaadb4b):

xcl-smoke v1
commit: fecb7c4d2c4721f3f99a83e00948091babaadb4b
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1633 (PresentX 1633)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14024 MB

Runtime log observations (xcl.log)

  • 9222 log lines, 0 [ERROR] / device-removal / panic lines.
  • Final draw/memory telemetry in log: 19642 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample 14024 MB committed by the process; video memory 6114 MB local, 4683 MB non-local.

Limits of coverage

  • Clearing stale root-changing command-signature classification when a new signature reuses a freed pointer address was verified via a_command_signature_made_at_a_freed_ones_address_does_not_keep_its_kind (3/3), hle::d3d12x::bind:: (9/9 × 3), and hle::d3d12x::device_x:: (14/14 × 3).
  • The 60 s retail smoke on title: 29640639 confirms zero runtime regression on command-signature creation and indirect execution (frame-count and commit deltas vs. cached parent reflect single-run startup variance, not this PR).

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7208692290 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2505#issuecomment-7208692290). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T03:05:09Z. --- Independent desktop NVIDIA verification of **PR #2505** at head `fecb7c4d2c4721f3f99a83e00948091babaadb4b` (`1` commit; exact parent & merge-base: `6d12f58a229bc73889878a448c64dc3af25eeba0`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted release tests & build (`fecb7c4d`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib a_command_signature_made_at_a_freed_ones_address_does_not_keep_its_kind -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1324 filtered out` × 3 (`0.00s` × 3, `0` skipped) | | `cargo test --release -p xcl --lib hle::d3d12x::bind:: -- --test-threads=1` (3 consecutive runs) | `9 passed; 0 failed; 0 ignored; 1316 filtered out` × 3 (`0.43s`, `0.44s`, `0.43s`, `0` skipped) | | `cargo test --release -p xcl --lib hle::d3d12x::device_x:: -- --test-threads=1` (3 consecutive runs) | `14 passed; 0 failed; 0 ignored; 1311 filtered out` × 3 (`0.34s`, `0.33s`, `0.34s`, `0` skipped) | | `cargo build --release -p xcl` | Clean build (`1m 06s`, exit `0`, `0` new warnings) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`6d12f58a229bc73889878a448c64dc3af25eeba0`, cached baseline on the same machine): ``` xcl-smoke v1 commit: 6d12f58a229bc73889878a448c64dc3af25eeba0 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1606 (PresentX 1606) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14004 MB ``` PR #2505 (`fecb7c4d2c4721f3f99a83e00948091babaadb4b`): ``` xcl-smoke v1 commit: fecb7c4d2c4721f3f99a83e00948091babaadb4b gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1633 (PresentX 1633) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14024 MB ``` ### Runtime log observations (`xcl.log`) - `9222` log lines, `0` `[ERROR]` / device-removal / panic lines. - Final draw/memory telemetry in log: `19642 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped)`; last memory sample `14024 MB committed by the process; video memory 6114 MB local, 4683 MB non-local`. ### Limits of coverage - Clearing stale root-changing command-signature classification when a new signature reuses a freed pointer address was verified via `a_command_signature_made_at_a_freed_ones_address_does_not_keep_its_kind` (`3/3`), `hle::d3d12x::bind::` (`9/9` × 3), and `hle::d3d12x::device_x::` (`14/14` × 3). - The 60 s retail smoke on `title: 29640639` confirms zero runtime regression on command-signature creation and indirect execution (frame-count and commit deltas vs. cached parent reflect single-run startup variance, not this PR). *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
tiagonleal commented 2026-11-28 12:35:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-28T12:35:19Z.


Closing this because main already fixes it. 5b03933e ("D3D12.X: snapshot indirect signature traits", by bmjask, in main since the #2959 stack) removed the ROOT_SIGNATURES set this PR cleaned up. Every successful CreateCommandSignature now writes one IndirectSignatureInfo record for its address, so a plain signature made at a freed root-changing one's address no longer inherits the stale bit. That is the bug this PR was for.

AI use: Claude Code wrote this comment (Claude Fable 5.2). Claude Opus 5.5 found the overlap while rebasing, and I checked 5b03933e against main e429936c before closing.

<!-- greyfinch-sync:ivall/xcl:comment:7239330403 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2505#issuecomment-7239330403). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-28T12:35:19Z. --- Closing this because `main` already fixes it. 5b03933e ("D3D12.X: snapshot indirect signature traits", by bmjask, in `main` since the #2959 stack) removed the `ROOT_SIGNATURES` set this PR cleaned up. Every successful `CreateCommandSignature` now writes one `IndirectSignatureInfo` record for its address, so a plain signature made at a freed root-changing one's address no longer inherits the stale bit. That is the bug this PR was for. **AI use:** Claude Code wrote this comment (Claude Fable 5.2). Claude Opus 5.5 found the overlap while rebasing, and I checked 5b03933e against `main` e429936c before closing.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2495
No description provided.