d3d12: validate inline scenes in queue publication order #514

Merged
MathiewMay merged 3 commits from upstream-pr/514 into main 2026-11-29 21:51:41 +00:00
MathiewMay commented 2026-11-29 18:42:01 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by MathiewMay on 2026-11-29T18:42:01Z.


Summary

Validate an inline scene using its stable logical pool/suballocation identity and its queue-ordered published GPU address, not the backing most recently selected by a different command-list recording. Retain the recorded resource through execution as before. Root-address scenes need submission checks too, not only table scenes and triangle-geometry programs.

Allocating larger storage for a later recording is not publication. A genuinely published successor, withdrawn scene, changed logical view, recycled pool or ambiguous overlap remains refused. This does not change AS allocation/publication policy, source-copy validation, inactive-instance behavior or resource retirement.

Regression proof

The test-only 61809a94 on pristine upstream fd636d09 gives two genuine native assertion failures: an earlier published scene is rejected after an unsubmitted larger allocation, and root scenes are not scheduled for submission rechecks. The current-main bug paths are unchanged in the subsequently fetched 2d6dc338.

With candidate 1a89fabda8cedb4978f7d488d89db8e9172f93a4, both focused native tests pass:

  • Build a real triangle BLAS and TLAS on the GPU, with TLAS storage selected by the production guest-memory allocator. Capture its inline scene, allocate a larger replacement without publishing it, and assert that the real native VAs differ while publication still names the old scene. Accepted validation is followed by an actual ray query: instance ID 37, distance 1.0, and both untouched output guards must match.
  • Require root-scene rechecks, force a real allocation growth for a successor, and verify rejection after publishing that successor or removing the recorded scene. Retaining the old storage alone must not make it current again.

Four additional unit controls cover pool/suballocation identity, queue-published addresses, recycled pools and ambiguous overlaps. These are native module regressions rather than a recognition-dependent console shader fixture: they deterministically force allocator growth and call the same submission validator. No retail shader or title capture is needed.

Validation

  • Complete isolated python tuxbox.py check --no-gpu: all seven groups pass. Windows native-test typecheck also passes.
  • Full translator GPU suite: 65/65 groups pass.
  • Full homebrew/Lanes verification: 126/126 checks pass.
  • D3D12 provider regression controls: 22/22 pass.
  • Native D3D12 tests: 412 passed, 1 failed, 8 ignored. Pristine fd636d09 is 406 passed, 1 failed, 8 ignored. Both fail the unchanged device::placement::check_pool::tests::check_chunk_runs_xmem_access_only_on_caller_thread assertion (left: 128, right: 64). That baseline failure is disclosed, not counted as passing or changed by this PR.

All full-suite results above belong to the exact candidate on fd636d09. The additional all-three run on refreshed main is reported separately below, not counted as this PR's isolated run.

Provider provenance: the final artifact reuses the byte-identical native DLL compiled at d25868a3; 1a89fabd changes only the native test's successor-allocation size and assertion, not production code. The final native test executable was rebuilt. A later pixel workstream exposed unsafe cross-worktree reuse in the shared compiled target; its stale pixel artifact was rejected. The descriptor PR's native build and this scene production-identical reuse were audited, and subsequent acceptance builds use new per-artifact compiled targets without cleaning or replacing existing caches.

Commands use placeholders for immutable source/helper/provider-SHA-bound artifacts. Native scene tests stage matching x64 DXC DLLs only in each private run directory, with dependency hashes in the receipt. GPU runs are sequential in an authenticated hidden/offline display using the stopped fixture prefix, without prefix copies or cache/save replacement:

python tuxbox.py check --no-gpu
cargo check --locked --offline --target x86_64-pc-windows-msvc -p tuxbox-d3d12 --tests
python "$MEASURE/run_windows_reuse.py" --unit tuxbox_d3d12 "$TEST_ONLY_MAIN_ARTIFACT" "$RED_WORK" scene_publication --nocapture
python "$CAMPAIGN/run_scene_units.py" "$ARTIFACT" "$TARGET_WORK" scene_publication --nocapture
python "$MEASURE/run_latest_translator.py" "$ARTIFACT" "$TRANSLATOR_WORK"
python "$MEASURE/run_latest_verify.py" "$ARTIFACT" "$VERIFY_WORK"
python "$MEASURE/run_latest_regressions.py" "$ARTIFACT" "$REGRESSION_WORK"
python "$CAMPAIGN/run_scene_units.py" "$ARTIFACT" "$UNIT_WORK"

GPU/backend: AMD Radeon RX 9070 (1002:7550, RADV GFX1201), Mesa 26.2.7, GE-Proton11-14 on Linux. NVIDIA validation is still missing and required before merge. This is an independent scene-publication fix; no retail launch or performance claim is made.

Additional all-three integration on refreshed main

A separate combined run of #512, #514 and #518 on 2d6dc33838f66c0784d539567628c07158351115 (private integration 08c5a6bf) used new per-artifact compiled targets. It is not an isolated run of this PR. All 7 code groups, 16 targeted checks, 66 translator groups, 133 homebrew checks and 22 provider controls pass. Swapping only D3D12 back to that clean main gives exactly seven expected descriptor/mirror reference-readback failures, while nine other targeted controls pass.

Native results are 449 passed / 4 failed / 8 ignored, versus pristine refreshed main's 431 passed / 4 failed / 8 ignored. The exact failure sets match; neither native suite is described as passing:

  • device::placement::check_pool::tests::check_chunk_collects_all_changes_and_merges_profile — 128 vs 64.
  • device::placement::check_pool::tests::check_chunk_reuses_cached_runs_and_retries_active_mapping_state — 32 vs 0.
  • device::placement::check_pool::tests::check_chunk_runs_xmem_access_only_on_caller_thread — 128 vs 64.
  • device::placement::guest_read::tests::section_watched_texture_caches_runs_and_invalidates_on_watch_or_mapping_change — 0 vs 1.

The first combined provider-control attempt stopped after one passing case because newer main requires its constant-buffer helper to be prebuilt. Building bash tools/build_frosty_cbv_layer.sh build/frosty-cbv-layer from the frozen sources into new private build output, without replacing a prior helper or changing frozen sources, made a fresh complete 22/22 run pass. The full native scene-capable runner then verified the four-failure baseline match. NVIDIA remains untested.

<!-- greyfinch-sync:brcly/TuxBox:issue:5553867941 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/514). Originally posted by [MathiewMay](https://github.com/MathiewMay) on 2026-11-29T18:42:01Z. --- ## Summary Validate an inline scene using its stable logical pool/suballocation identity and its queue-ordered published GPU address, not the backing most recently selected by a different command-list recording. Retain the recorded resource through execution as before. Root-address scenes need submission checks too, not only table scenes and triangle-geometry programs. Allocating larger storage for a later recording is not publication. A genuinely published successor, withdrawn scene, changed logical view, recycled pool or ambiguous overlap remains refused. This does not change AS allocation/publication policy, source-copy validation, inactive-instance behavior or resource retirement. ## Regression proof The test-only `61809a94` on pristine upstream `fd636d09` gives two genuine native assertion failures: an earlier published scene is rejected after an unsubmitted larger allocation, and root scenes are not scheduled for submission rechecks. The current-main bug paths are unchanged in the subsequently fetched `2d6dc338`. With candidate `1a89fabda8cedb4978f7d488d89db8e9172f93a4`, both focused native tests pass: - Build a real triangle BLAS and TLAS on the GPU, with TLAS storage selected by the production guest-memory allocator. Capture its inline scene, allocate a larger replacement without publishing it, and assert that the real native VAs differ while publication still names the old scene. Accepted validation is followed by an actual ray query: instance ID **37**, distance **1.0**, and both untouched output guards must match. - Require root-scene rechecks, force a real allocation growth for a successor, and verify rejection after publishing that successor or removing the recorded scene. Retaining the old storage alone must not make it current again. Four additional unit controls cover pool/suballocation identity, queue-published addresses, recycled pools and ambiguous overlaps. These are native module regressions rather than a recognition-dependent console shader fixture: they deterministically force allocator growth and call the same submission validator. No retail shader or title capture is needed. ## Validation - Complete isolated `python tuxbox.py check --no-gpu`: **all seven groups pass**. Windows native-test typecheck also passes. - Full translator GPU suite: **65/65 groups pass**. - Full homebrew/Lanes verification: **126/126 checks pass**. - D3D12 provider regression controls: **22/22 pass**. - Native D3D12 tests: **412 passed, 1 failed, 8 ignored**. Pristine `fd636d09` is **406 passed, 1 failed, 8 ignored**. Both fail the unchanged `device::placement::check_pool::tests::check_chunk_runs_xmem_access_only_on_caller_thread` assertion (`left: 128`, `right: 64`). That baseline failure is disclosed, not counted as passing or changed by this PR. All full-suite results above belong to the exact candidate on `fd636d09`. The additional all-three run on refreshed main is reported separately below, not counted as this PR's isolated run. Provider provenance: the final artifact reuses the byte-identical native DLL compiled at `d25868a3`; `1a89fabd` changes only the native test's successor-allocation size and assertion, not production code. The final native test executable was rebuilt. A later pixel workstream exposed unsafe cross-worktree reuse in the shared compiled target; its stale pixel artifact was rejected. The descriptor PR's native build and this scene production-identical reuse were audited, and subsequent acceptance builds use new per-artifact compiled targets without cleaning or replacing existing caches. Commands use placeholders for immutable source/helper/provider-SHA-bound artifacts. Native scene tests stage matching x64 DXC DLLs only in each private run directory, with dependency hashes in the receipt. GPU runs are sequential in an authenticated hidden/offline display using the stopped fixture prefix, without prefix copies or cache/save replacement: ```sh python tuxbox.py check --no-gpu cargo check --locked --offline --target x86_64-pc-windows-msvc -p tuxbox-d3d12 --tests python "$MEASURE/run_windows_reuse.py" --unit tuxbox_d3d12 "$TEST_ONLY_MAIN_ARTIFACT" "$RED_WORK" scene_publication --nocapture python "$CAMPAIGN/run_scene_units.py" "$ARTIFACT" "$TARGET_WORK" scene_publication --nocapture python "$MEASURE/run_latest_translator.py" "$ARTIFACT" "$TRANSLATOR_WORK" python "$MEASURE/run_latest_verify.py" "$ARTIFACT" "$VERIFY_WORK" python "$MEASURE/run_latest_regressions.py" "$ARTIFACT" "$REGRESSION_WORK" python "$CAMPAIGN/run_scene_units.py" "$ARTIFACT" "$UNIT_WORK" ``` GPU/backend: AMD Radeon RX 9070 (`1002:7550`, RADV GFX1201), Mesa 26.2.7, GE-Proton11-14 on Linux. **NVIDIA validation is still missing and required before merge.** This is an independent scene-publication fix; no retail launch or performance claim is made. ## Additional all-three integration on refreshed main A separate **combined** run of #512, #514 and #518 on `2d6dc33838f66c0784d539567628c07158351115` (private integration `08c5a6bf`) used new per-artifact compiled targets. It is not an isolated run of this PR. All **7 code groups, 16 targeted checks, 66 translator groups, 133 homebrew checks and 22 provider controls pass**. Swapping only D3D12 back to that clean main gives **exactly seven expected descriptor/mirror reference-readback failures**, while nine other targeted controls pass. Native results are **449 passed / 4 failed / 8 ignored**, versus pristine refreshed main's **431 passed / 4 failed / 8 ignored**. The exact failure sets match; neither native suite is described as passing: - `device::placement::check_pool::tests::check_chunk_collects_all_changes_and_merges_profile` — 128 vs 64. - `device::placement::check_pool::tests::check_chunk_reuses_cached_runs_and_retries_active_mapping_state` — 32 vs 0. - `device::placement::check_pool::tests::check_chunk_runs_xmem_access_only_on_caller_thread` — 128 vs 64. - `device::placement::guest_read::tests::section_watched_texture_caches_runs_and_invalidates_on_watch_or_mapping_change` — 0 vs 1. The first combined provider-control attempt stopped after one passing case because newer main requires its constant-buffer helper to be prebuilt. Building `bash tools/build_frosty_cbv_layer.sh build/frosty-cbv-layer` from the frozen sources into new private build output, without replacing a prior helper or changing frozen sources, made a fresh complete **22/22** run pass. The full native scene-capable runner then verified the four-failure baseline match. NVIDIA remains untested.
NickStallman commented 2026-11-29 20:19:45 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T20:19:45Z.


NVIDIA run: full python tuxbox.py check passes on an RTX 5090 (10de:2b85, 620.70.10, GE-Proton11-14, Linux, windows-dxc 1.8.2505.1).

Tree Pass Fail
main 2d6dc338 (control, same card and prefix) 192 0
1a89fabd merged into 2d6dc338 (clean merge) 192 0

No GPU errors in the kernel log. A first attempt had 11 timeouts in basic gates while other work of mine loaded the machine (load 24, and it ran out of memory at one point); the rerun at load 12 is the result above.

Not run: the native D3D12 unit tests that cover this change (they aren't part of check), and the game. On our integration branch, the scene_publication tests crash (0xc0000005) with Vulkan disabled, where they can't create a device; I haven't run them with a driver.

<!-- greyfinch-sync:brcly/TuxBox:comment:7261991221 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/514#issuecomment-7261991221). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T20:19:45Z. --- NVIDIA run: **full `python tuxbox.py check` passes** on an RTX 5090 (`10de:2b85`, 620.70.10, GE-Proton11-14, Linux, `windows-dxc` 1.8.2505.1). | Tree | Pass | Fail | |---|---|---| | `main` 2d6dc338 (control, same card and prefix) | 192 | 0 | | 1a89fabd merged into 2d6dc338 (clean merge) | 192 | 0 | No GPU errors in the kernel log. A first attempt had 11 timeouts in basic gates while other work of mine loaded the machine (load 24, and it ran out of memory at one point); the rerun at load 12 is the result above. Not run: the native D3D12 unit tests that cover this change (they aren't part of `check`), and the game. On our integration branch, the `scene_publication` tests crash (0xc0000005) with Vulkan disabled, where they can't create a device; I haven't run them with a driver.
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
brcly/TuxBox!514
No description provided.