startup: name the causes of a refused placed build and accept PERFORM_UPDATE with a source structure #1936

Open
tedin7 wants to merge 13 commits from upstream-pr/1943 into main
tedin7 commented 2026-11-24 21:58:38 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T21:58:38Z.


Part of #1758 (and #870); no Fixes.

What this unblocks: a refused placed acceleration-structure build now says why (six causes were one opaque E_INVALIDARG), and a placed PERFORM_UPDATE with a source structure is accepted through the same placement lookup as the build.

Source: DirectX-Specs, Raytracing, "Acceleration structure update" (PERFORM_UPDATE, ALLOW_UPDATE, SourceAccelerationStructureData, UpdateScratchDataSizeInBytes from GetRaytracingAccelerationStructurePrebuildInfo); Direct3D 12 documentation, D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS; and the earlier placed-build code of this repository (placed_build.h).

resolve_placed_build collapsed six different refusals into one opaque E_INVALIDARG and refused every update build. This names the causes and accepts PERFORM_UPDATE with a source structure. d3d12_memory_srv.inl and placed_buffer_range are untouched.

Reply to the 2026-11-24 review

The requested update path is covered by check_placed_update (tests/dxr_check.cpp:512), called at the end of check_dxr_placed_build (tests/dxr_check.cpp:581), so it runs in dxr_placed_build_warp and dxr_placed_build_hardware.

  • Source built with ALLOW_UPDATE: the fixture builds the BLAS and TLAS with ALLOW_UPDATE (tests/dxr_check.cpp:231) through the placed resolver.
  • Update through the placed path: placedScene->resolve_update re-resolves the BLAS and the TLAS as in-place PERFORM_UPDATE builds (tests/dxr_check.cpp:384-386, tests/dxr_placed_build.h:246) and the translated builds are recorded after UAV barriers (:387-390).
  • Changed ray result: the instances move and the geometry changes, rays are traced and read back after a UAV barrier, a queue signal and a fence wait (submit_and_wait, tests/desktop_gpu.cpp:81-91). The test requires the result to differ from the pre-update result (tests/dxr_check.cpp:532), to carry the expected hit instance IDs per ray (:534-538), and to equal both the same update on desktop addresses and a fresh placed build of the updated scene (:530-531).
  • Refusal controls stay: every resolver refusal is asserted by cause in the same test (tests/dxr_placed_build.h), including an update whose source was built without ALLOW_UPDATE (source_not_updatable) and one never built (source_not_built).
  • Precondition: documented in docs/experiments.md and now enforced by the resolver (it records ALLOW_UPDATE per build and refuses an update without it).

Changes

  • src/startup_stubs/placed_build.h: a standard-C++-only part with PlacedBuildCause (ok, unaligned, not_placed, wrong_state, range, update_without_source, source_without_update, source_unaligned, source_not_placed, source_wrong_state, source_range, source_dest_partial_overlap, source_not_built, source_not_updatable), cause_name, ranges_overlap, check_update_shape, gpu_range_cause and PlacedBuildLedger. The Windows declarations stay below, under _WIN32.
  • resolve_placed_build returns the same E_INVALIDARG and still publishes nothing on a refusal, and now logs x2w-dxr placed build refused: <cause> (<dest|scratch|source> at title 0x...) once per cause.
  • With PERFORM_UPDATE, the source goes through the same placement lookup as the destination, unchanged (a live placed buffer in the acceleration-structure state, 256-byte aligned). The scratch is sized by UpdateScratchDataSizeInBytes. The update may run in place (source == destination) or write another structure; a source that partly overlaps the destination is refused. Nothing is published unless all three addresses resolve. The resolver records the ALLOW_UPDATE flag of every build it publishes (keyed by the structure's title address; a later build over the same memory replaces the record) and refuses an update whose source was recorded without it (source_not_updatable) or never seen built (source_not_built). resolve_placed_build reports its cause through an optional out parameter.
  • tests/placed_build_causes_check.cpp (registered as placed_build_causes): the device-free rules, including both aliasing outcomes and the boundaries. tests/dxr_placed_build.h (used by dxr_placed_build_{hardware,warp}): six refused updates (no source, source without the flag, unaligned, unmapped, wrong state, partial overlap), an in-place update and an out-of-place one with its interior offset kept.
  • Notes in docs/experiments.md.

Verified (Linux)

  • g++ -std=c++17 -O2 -Wall -Wextra -fsanitize=address,undefined on tests/placed_build_causes_check.cpp: no warnings, passes.
  • Five mutations of placed_build.h, each failing the check, original restored: in-place update refused, partial overlap accepted, overlap boundary off by one, source alignment unchecked, update flag without source accepted.
  • MinGW -fsyntax-only on d3d12_xs_device.cpp (only the MSVC-only __try/__except of local_log.h, as on main) and on tests/cpu/placed_dxr_provider.cpp, which includes the fixture header.
  • git diff --check origin/main...HEAD, tests/docs_links_check.py, tests/bidi_controls_check.py: pass.
  • git merge-tree: no conflicts with main, #1766, #1787, #1788, #1789, #1744, #1726. #1441 already conflicts with main on its own.

Verification (Windows Server 2025, D3D12 WARP, head 5a79addf, after merging current main)

  • Debug: cmake --build --preset dev --target placed_build_causes_check offscreen_check -- -j 2, then ctest --preset dev -R '^(placed_build_causes|dxr_placed_build_|dxr_slot70_as_|dxr_update)' --no-tests=error --output-on-failure: 9/9 passed (placed_build_causes, dxr_placed_build_{warp,hardware}, dxr_slot70_as_{warp,hardware}, dxr_update_{warp,hardware}, dxr_update_pipeline_{warp,hardware}).
  • Release /O2: the same build and ctest commands with --preset release: 9/9 passed, same nine tests.
  • Linux: g++ -std=c++17 -O2 -Wall -Wextra -fsanitize=address,undefined tests/placed_build_causes_check.cpp passes; eight mutations of placed_build.h (allow-update ignored, unknown source accepted, overlap record not dropped, flag forced on, three variants of the address rule, a missing name) each fail the check.
  • The device tests require the named cause for every refusal a device can trigger (destination and scratch not placed, unaligned, wrong state; no source, source without the flag, unaligned, not placed, wrong state, one stride past the destination, never built, built without ALLOW_UPDATE). range and source_range cannot be triggered on a real device (buffers are placed 64 KB aligned), so the address rule is checked by value in placed_build_causes.

Not verified

  • An out-of-place update is resolved but not dispatched. The in-place PERFORM_UPDATE of the placed BLAS and TLAS (built with ALLOW_UPDATE) is recorded and read back in dxr_placed_build_{hardware,warp}.
  • The ledger records builds that go through this resolver; a structure built another way has no record and an update from it is refused.

AI-assisted; commands listed were executed locally.


Replaces closed draft #1799 (rebased cleanly on origin/main and verified on Win2025: 3/3 Debug + 3/3 Release).
AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5481025332 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T21:58:38Z. --- Part of #1758 (and #870); no `Fixes`. What this unblocks: a refused placed acceleration-structure build now says why (six causes were one opaque `E_INVALIDARG`), and a placed `PERFORM_UPDATE` with a source structure is accepted through the same placement lookup as the build. Source: DirectX-Specs, Raytracing, "Acceleration structure update" (`PERFORM_UPDATE`, `ALLOW_UPDATE`, `SourceAccelerationStructureData`, `UpdateScratchDataSizeInBytes` from `GetRaytracingAccelerationStructurePrebuildInfo`); Direct3D 12 documentation, `D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS`; and the earlier placed-build code of this repository (`placed_build.h`). `resolve_placed_build` collapsed six different refusals into one opaque `E_INVALIDARG` and refused every update build. This names the causes and accepts `PERFORM_UPDATE` with a source structure. `d3d12_memory_srv.inl` and `placed_buffer_range` are untouched. ### Reply to the 2026-11-24 review The requested update path is covered by `check_placed_update` (`tests/dxr_check.cpp:512`), called at the end of `check_dxr_placed_build` (`tests/dxr_check.cpp:581`), so it runs in `dxr_placed_build_warp` and `dxr_placed_build_hardware`. - Source built with `ALLOW_UPDATE`: the fixture builds the BLAS and TLAS with `ALLOW_UPDATE` (`tests/dxr_check.cpp:231`) through the placed resolver. - Update through the placed path: `placedScene->resolve_update` re-resolves the BLAS and the TLAS as in-place `PERFORM_UPDATE` builds (`tests/dxr_check.cpp:384-386`, `tests/dxr_placed_build.h:246`) and the translated builds are recorded after UAV barriers (`:387-390`). - Changed ray result: the instances move and the geometry changes, rays are traced and read back after a UAV barrier, a queue signal and a fence wait (`submit_and_wait`, `tests/desktop_gpu.cpp:81-91`). The test requires the result to differ from the pre-update result (`tests/dxr_check.cpp:532`), to carry the expected hit instance IDs per ray (`:534-538`), and to equal both the same update on desktop addresses and a fresh placed build of the updated scene (`:530-531`). - Refusal controls stay: every resolver refusal is asserted by cause in the same test (`tests/dxr_placed_build.h`), including an update whose source was built without `ALLOW_UPDATE` (`source_not_updatable`) and one never built (`source_not_built`). - Precondition: documented in `docs/experiments.md` and now enforced by the resolver (it records `ALLOW_UPDATE` per build and refuses an update without it). ### Changes - `src/startup_stubs/placed_build.h`: a standard-C++-only part with `PlacedBuildCause` (`ok`, `unaligned`, `not_placed`, `wrong_state`, `range`, `update_without_source`, `source_without_update`, `source_unaligned`, `source_not_placed`, `source_wrong_state`, `source_range`, `source_dest_partial_overlap`, `source_not_built`, `source_not_updatable`), `cause_name`, `ranges_overlap`, `check_update_shape`, `gpu_range_cause` and `PlacedBuildLedger`. The Windows declarations stay below, under `_WIN32`. - `resolve_placed_build` returns the same `E_INVALIDARG` and still publishes nothing on a refusal, and now logs `x2w-dxr placed build refused: <cause> (<dest|scratch|source> at title 0x...)` once per cause. - With `PERFORM_UPDATE`, the source goes through the same placement lookup as the destination, unchanged (a live placed buffer in the acceleration-structure state, 256-byte aligned). The scratch is sized by `UpdateScratchDataSizeInBytes`. The update may run in place (source == destination) or write another structure; a source that partly overlaps the destination is refused. Nothing is published unless all three addresses resolve. The resolver records the `ALLOW_UPDATE` flag of every build it publishes (keyed by the structure's title address; a later build over the same memory replaces the record) and refuses an update whose source was recorded without it (`source_not_updatable`) or never seen built (`source_not_built`). `resolve_placed_build` reports its cause through an optional out parameter. - `tests/placed_build_causes_check.cpp` (registered as `placed_build_causes`): the device-free rules, including both aliasing outcomes and the boundaries. `tests/dxr_placed_build.h` (used by `dxr_placed_build_{hardware,warp}`): six refused updates (no source, source without the flag, unaligned, unmapped, wrong state, partial overlap), an in-place update and an out-of-place one with its interior offset kept. - Notes in `docs/experiments.md`. ### Verified (Linux) - `g++ -std=c++17 -O2 -Wall -Wextra -fsanitize=address,undefined` on `tests/placed_build_causes_check.cpp`: no warnings, passes. - Five mutations of `placed_build.h`, each failing the check, original restored: in-place update refused, partial overlap accepted, overlap boundary off by one, source alignment unchecked, update flag without source accepted. - MinGW `-fsyntax-only` on `d3d12_xs_device.cpp` (only the MSVC-only `__try`/`__except` of `local_log.h`, as on `main`) and on `tests/cpu/placed_dxr_provider.cpp`, which includes the fixture header. - `git diff --check origin/main...HEAD`, `tests/docs_links_check.py`, `tests/bidi_controls_check.py`: pass. - `git merge-tree`: no conflicts with `main`, #1766, #1787, #1788, #1789, #1744, #1726. #1441 already conflicts with `main` on its own. ### Verification (Windows Server 2025, D3D12 WARP, head 5a79addf, after merging current `main`) - Debug: `cmake --build --preset dev --target placed_build_causes_check offscreen_check -- -j 2`, then `ctest --preset dev -R '^(placed_build_causes|dxr_placed_build_|dxr_slot70_as_|dxr_update)' --no-tests=error --output-on-failure`: 9/9 passed (`placed_build_causes`, `dxr_placed_build_{warp,hardware}`, `dxr_slot70_as_{warp,hardware}`, `dxr_update_{warp,hardware}`, `dxr_update_pipeline_{warp,hardware}`). - Release `/O2`: the same build and ctest commands with `--preset release`: 9/9 passed, same nine tests. - Linux: `g++ -std=c++17 -O2 -Wall -Wextra -fsanitize=address,undefined tests/placed_build_causes_check.cpp` passes; eight mutations of `placed_build.h` (allow-update ignored, unknown source accepted, overlap record not dropped, flag forced on, three variants of the address rule, a missing name) each fail the check. - The device tests require the named cause for every refusal a device can trigger (destination and scratch not placed, unaligned, wrong state; no source, source without the flag, unaligned, not placed, wrong state, one stride past the destination, never built, built without `ALLOW_UPDATE`). `range` and `source_range` cannot be triggered on a real device (buffers are placed 64 KB aligned), so the address rule is checked by value in `placed_build_causes`. ### Not verified - An out-of-place update is resolved but not dispatched. The in-place `PERFORM_UPDATE` of the placed BLAS and TLAS (built with `ALLOW_UPDATE`) is recorded and read back in `dxr_placed_build_{hardware,warp}`. - The ledger records builds that go through this resolver; a structure built another way has no record and an update from it is refused. AI-assisted; commands listed were executed locally. --- Replaces closed draft #1799 (rebased cleanly on origin/main and verified on Win2025: 3/3 Debug + 3/3 Release). AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-24 22:01:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T21:58:51Z.


Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-26T11:49:41.635633Z
We couldn’t complete this review. Comment @codex review to try again.
5a79add Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7145642499 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7145642499). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T21:58:51Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"5a79addf711b8934ee45a77906fd4be1be98f8ad","has_any_findings":true,"has_unresolved_findings":true,"status":"failed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ❌ Failed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ❌ **Failed** <relative-time datetime="2026-11-26T11:49:41.635633Z">2026-11-26T11:49:41.635633Z</relative-time><br/>We couldn’t complete this review. Comment `@codex review` to try again. | `5a79add` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
R0Y00 commented 2026-11-24 22:19:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T22:19:04Z.

Review: CHANGES_REQUESTED


The refusal diagnostics can land independently. The new accepted PERFORM_UPDATE cases currently stop at resolve_placed_build. Before accepting production updates, please build the source with ALLOW_UPDATE, record and submit at least one update through the placed path, then read back a changed ray result with the normal barriers and fence. Keep the existing resolver refusal controls. Also document the caller precondition for an update-capable source, or reject an initial build without it if the shim can track that provenance. D3D12 build flags

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6048302818 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#pullrequestreview-6048302818). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T22:19:04Z. **Review:** CHANGES_REQUESTED --- The refusal diagnostics can land independently. The new accepted `PERFORM_UPDATE` cases currently stop at `resolve_placed_build`. Before accepting production updates, please build the source with `ALLOW_UPDATE`, record and submit at least one update through the placed path, then read back a changed ray result with the normal barriers and fence. Keep the existing resolver refusal controls. Also document the caller precondition for an update-capable source, or reject an initial build without it if the shim can track that provenance. [D3D12 build flags](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_raytracing_acceleration_structure_build_flags)
tedin7 commented 2026-11-25 02:02:05 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:11:16Z.


Part of #870, #1758. Addressed the review in 8e402dcc and 1c5de00a (head 1c5de00a).

  • dxr_placed_build_{hardware,warp} now builds the placed BLAS and TLAS with ALLOW_UPDATE, records an in-place PERFORM_UPDATE of both through resolve_placed_build (source = the title address of the initial build), and reads back four rays after the normal UAV barriers and fence. The hit instance IDs change from 7, 11, 0, 0 to 0, 0, 7, 11, and the rows equal the same update on desktop addresses and a fresh placed build of the updated scene. The resolver refusal controls are unchanged.
  • Found by the new test: WARP reports UpdateScratchDataSizeInBytes = 0, and the resolver refused that as an unplaced scratch. A null scratch is now accepted when no update scratch is needed, and a scratch that is passed anyway must still be a placed buffer. Covered by new controls in the fixture.
  • docs/experiments.md now states the caller precondition: the shim does not track provenance, so a source structure must have been built with ALLOW_UPDATE.
  • Out-of-place updates are resolved but not dispatched.

Verification (Win2025 node, x2w_pipe.py win2025 1943 --regex '^(placed_build_causes|dxr_)' at 1c5de00a): placed_build_causes, dxr_placed_build_warp, dxr_placed_build_hardware and the other dxr_* WARP tests pass (20/21). dxr_opacity_hardware fails (candidate handling vs CPU reference). That test does not use the placed path, and I did not run it on main to confirm it was already failing.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7149293846 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7149293846). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T01:11:16Z. --- Part of #870, #1758. Addressed the review in 8e402dcc and 1c5de00a (head 1c5de00a). - `dxr_placed_build_{hardware,warp}` now builds the placed BLAS and TLAS with `ALLOW_UPDATE`, records an in-place `PERFORM_UPDATE` of both through `resolve_placed_build` (source = the title address of the initial build), and reads back four rays after the normal UAV barriers and fence. The hit instance IDs change from 7, 11, 0, 0 to 0, 0, 7, 11, and the rows equal the same update on desktop addresses and a fresh placed build of the updated scene. The resolver refusal controls are unchanged. - Found by the new test: WARP reports `UpdateScratchDataSizeInBytes = 0`, and the resolver refused that as an unplaced scratch. A null scratch is now accepted when no update scratch is needed, and a scratch that is passed anyway must still be a placed buffer. Covered by new controls in the fixture. - `docs/experiments.md` now states the caller precondition: the shim does not track provenance, so a source structure must have been built with `ALLOW_UPDATE`. - Out-of-place updates are resolved but not dispatched. Verification (Win2025 node, `x2w_pipe.py win2025 1943 --regex '^(placed_build_causes|dxr_)'` at 1c5de00a): `placed_build_causes`, `dxr_placed_build_warp`, `dxr_placed_build_hardware` and the other `dxr_*` WARP tests pass (20/21). `dxr_opacity_hardware` fails (candidate handling vs CPU reference). That test does not use the placed path, and I did not run it on main to confirm it was already failing. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 14:04:22 +00:00
tedin7 commented 2026-11-25 14:05:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T13:50:33Z.


Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is.

We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7164369272 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7164369272). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T13:50:33Z. --- Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is. We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here. AI-assisted; commands listed were executed locally.
upstream-sync reopened this pull request 2026-11-26 11:02:39 +00:00
tedin7 commented 2026-11-26 11:03:00 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T10:41:06Z.


Reopened and brought to date: main is merged into the branch (merge commit, no force push, head 047f6f0c). One conflict, in tests/dxr_placed_build.h, where main added the slot-70 acceleration-structure view publishing and this branch the update checks; both are kept.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 047f6f0cc35aca3f34df5dff87d253053e7bf5a0:

  • Debug (--preset dev): cmake --build --preset dev --target placed_build_causes_check offscreen_check -- -j 2, then ctest --preset dev -R '^(placed_build_causes|dxr_placed_build_|dxr_slot70_as_)' --no-tests=error --output-on-failure: 5/5 passed (placed_build_causes, dxr_placed_build_warp, dxr_placed_build_hardware, dxr_slot70_as_warp, dxr_slot70_as_hardware).
  • Release /O2 (--preset release): the same build and ctest commands: 5/5 passed, same five tests.
  • Linux: g++ -std=c++17 -Wall -Wextra tests/placed_build_causes_check.cpp passes; git diff --check is clean.

The earlier review round (build the source with ALLOW_UPDATE, record and read back an update, document the caller precondition) was already addressed on this branch before the merge. The PR body now has the Source: line and the verification above. An independent Stage-2 review is requested; this stays a Draft until it passes.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7189694538 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7189694538). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T10:41:06Z. --- Reopened and brought to date: `main` is merged into the branch (merge commit, no force push, head `047f6f0c`). One conflict, in `tests/dxr_placed_build.h`, where `main` added the slot-70 acceleration-structure view publishing and this branch the update checks; both are kept. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `047f6f0cc35aca3f34df5dff87d253053e7bf5a0`: - Debug (`--preset dev`): `cmake --build --preset dev --target placed_build_causes_check offscreen_check -- -j 2`, then `ctest --preset dev -R '^(placed_build_causes|dxr_placed_build_|dxr_slot70_as_)' --no-tests=error --output-on-failure`: 5/5 passed (`placed_build_causes`, `dxr_placed_build_warp`, `dxr_placed_build_hardware`, `dxr_slot70_as_warp`, `dxr_slot70_as_hardware`). - Release `/O2` (`--preset release`): the same build and ctest commands: 5/5 passed, same five tests. - Linux: `g++ -std=c++17 -Wall -Wextra tests/placed_build_causes_check.cpp` passes; `git diff --check` is clean. The earlier review round (build the source with `ALLOW_UPDATE`, record and read back an update, document the caller precondition) was already addressed on this branch before the merge. The PR body now has the `Source:` line and the verification above. An independent Stage-2 review is requested; this stays a Draft until it passes. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 12:04:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T11:22:44Z.


The three gate findings are fixed (head 5a79addf, main merged, no force push).

  1. ALLOW_UPDATE provenance: the resolver records the flag of every build it publishes and refuses an update whose source was built without it (source_not_updatable) or that it never saw built (source_not_built; unknown provenance is refused). A refused call records nothing; a later build over the same memory replaces the record, and an update's destination is recorded with the update's flags.
  2. Named causes at device level: resolve_placed_build reports its cause through an optional out parameter, and every refusal in dxr_placed_build_{warp,hardware} now requires the exact cause, not only E_INVALIDARG.
  3. A triggering control for each cause a device can reach: destination and scratch (not placed, unaligned, wrong state), and for an update no source, a source without the flag, an unaligned, not placed or wrong-state source, a source one stride past the destination (partial overlap on a device that sizes the structure over 256 bytes), a source never built, and a source built without ALLOW_UPDATE. range and source_range cannot be triggered on a real device (buffers are placed 64 KB aligned), so the translated-address rule is checked by value in placed_build_causes, with the ledger rules; eight mutations of placed_build.h each fail that check.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 5a79addf711b8934ee45a77906fd4be1be98f8ad:

  • Debug (--preset dev): cmake --build --preset dev --target placed_build_causes_check offscreen_check -- -j 2, then ctest --preset dev -R '^(placed_build_causes|dxr_placed_build_|dxr_slot70_as_|dxr_update)' --no-tests=error --output-on-failure: 9/9 passed (placed_build_causes, dxr_placed_build_{warp,hardware}, dxr_slot70_as_{warp,hardware}, dxr_update_{warp,hardware}, dxr_update_pipeline_{warp,hardware}).
  • Release /O2 (--preset release): the same build and ctest commands: 9/9 passed, same nine tests.
  • Linux: the device-free check passes under address and undefined-behaviour sanitizers; git diff --check and the docs link check are clean.

Stage-2 re-gate requested. This stays a Draft until it passes.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7190649047 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7190649047). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T11:22:44Z. --- The three gate findings are fixed (head `5a79addf`, `main` merged, no force push). 1. `ALLOW_UPDATE` provenance: the resolver records the flag of every build it publishes and refuses an update whose source was built without it (`source_not_updatable`) or that it never saw built (`source_not_built`; unknown provenance is refused). A refused call records nothing; a later build over the same memory replaces the record, and an update's destination is recorded with the update's flags. 2. Named causes at device level: `resolve_placed_build` reports its cause through an optional out parameter, and every refusal in `dxr_placed_build_{warp,hardware}` now requires the exact cause, not only `E_INVALIDARG`. 3. A triggering control for each cause a device can reach: destination and scratch (not placed, unaligned, wrong state), and for an update no source, a source without the flag, an unaligned, not placed or wrong-state source, a source one stride past the destination (partial overlap on a device that sizes the structure over 256 bytes), a source never built, and a source built without `ALLOW_UPDATE`. `range` and `source_range` cannot be triggered on a real device (buffers are placed 64 KB aligned), so the translated-address rule is checked by value in `placed_build_causes`, with the ledger rules; eight mutations of `placed_build.h` each fail that check. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `5a79addf711b8934ee45a77906fd4be1be98f8ad`: - Debug (`--preset dev`): `cmake --build --preset dev --target placed_build_causes_check offscreen_check -- -j 2`, then `ctest --preset dev -R '^(placed_build_causes|dxr_placed_build_|dxr_slot70_as_|dxr_update)' --no-tests=error --output-on-failure`: 9/9 passed (`placed_build_causes`, `dxr_placed_build_{warp,hardware}`, `dxr_slot70_as_{warp,hardware}`, `dxr_update_{warp,hardware}`, `dxr_update_pipeline_{warp,hardware}`). - Release `/O2` (`--preset release`): the same build and ctest commands: 9/9 passed, same nine tests. - Linux: the device-free check passes under address and undefined-behaviour sanitizers; `git diff --check` and the docs link check are clean. Stage-2 re-gate requested. This stays a Draft until it passes. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 12:04:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T11:49:39Z.


Independent re-review of head 5a79addf71: PASS.

Verification (Windows Server 2025, D3D12 WARP, build and tests on the PR head, run through the repository's Win2025 pipeline on its own host):

  • ctest -R '^(placed_build_causes|dxr_placed_build_|dxr_slot70_as_|dxr_update)': dev 9/9 and release 9/9 (placed_build_causes, dxr_placed_build_warp, dxr_placed_build_hardware, dxr_slot70_as_warp, dxr_slot70_as_hardware, dxr_update_warp, dxr_update_hardware, dxr_update_pipeline_warp, dxr_update_pipeline_hardware).
  • Extra control, run on top of the head: the TLAS rebuilt without ALLOW_UPDATE is refused as source_not_updatable for an in-place update, and the same update is accepted after the TLAS is rebuilt with ALLOW_UPDATE (dxr_placed_build_warp 1/1).
  • Linux: g++ -std=c++17 -O2 -Wall -Wextra -fsanitize=address,undefined tests/placed_build_causes_check.cpp: no warnings, passes; git diff --check origin/main...HEAD clean.
  • Each refusal control now asserts the named cause, not only E_INVALIDARG. range / source_range are checked by value through gpu_range_cause only, because a real device places buffers 64 KB aligned (stated in the header).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7191215875 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7191215875). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T11:49:39Z. --- Independent re-review of head 5a79addf711b8934ee45a77906fd4be1be98f8ad: PASS. Verification (Windows Server 2025, D3D12 WARP, build and tests on the PR head, run through the repository's Win2025 pipeline on its own host): - `ctest -R '^(placed_build_causes|dxr_placed_build_|dxr_slot70_as_|dxr_update)'`: dev 9/9 and release 9/9 (`placed_build_causes`, `dxr_placed_build_warp`, `dxr_placed_build_hardware`, `dxr_slot70_as_warp`, `dxr_slot70_as_hardware`, `dxr_update_warp`, `dxr_update_hardware`, `dxr_update_pipeline_warp`, `dxr_update_pipeline_hardware`). - Extra control, run on top of the head: the TLAS rebuilt without `ALLOW_UPDATE` is refused as `source_not_updatable` for an in-place update, and the same update is accepted after the TLAS is rebuilt with `ALLOW_UPDATE` (`dxr_placed_build_warp` 1/1). - Linux: `g++ -std=c++17 -O2 -Wall -Wextra -fsanitize=address,undefined tests/placed_build_causes_check.cpp`: no warnings, passes; `git diff --check origin/main...HEAD` clean. - Each refusal control now asserts the named cause, not only `E_INVALIDARG`. `range` / `source_range` are checked by value through `gpu_range_cause` only, because a real device places buffers 64 KB aligned (stated in the header). AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-26 12:04:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T11:49:47Z.


You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7191218365 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7191218365). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T11:49:47Z. --- You have reached your Codex usage limits for code reviews. You can see your limits in the [Codex usage dashboard](https://chatgpt.com/codex/cloud/settings/usage). To continue using code reviews, add credits to your account and enable them for code reviews in your [settings](https://chatgpt.com/settings/code-review).
tedin7 commented 2026-11-26 12:04:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T11:54:28Z.


@MasterDomino #1943 is tested and Ready as well (Win2025 dev 9/9 + release 9/9 at 5a79addf7).

R0Y00's change request is covered: check_placed_update (tests/dxr_check.cpp:512, run from dxr_placed_build_warp and _hardware) builds with ALLOW_UPDATE, submits a placed PERFORM_UPDATE of the BLAS and TLAS through the resolver, and reads back a changed ray result with UAV barriers and a fence, compared with a direct update and a fresh build. The resolver refusal controls are kept, and an update of a source built without ALLOW_UPDATE is now refused as source_not_updatable. Details are in the PR body.

Full merge order from our side: #1408, #1251, #1939, #1940, #1943, #2782, #2794, #2766.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7191318123 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7191318123). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T11:54:28Z. --- @MasterDomino #1943 is tested and Ready as well (Win2025 dev 9/9 + release 9/9 at 5a79addf7). R0Y00's change request is covered: `check_placed_update` (`tests/dxr_check.cpp:512`, run from `dxr_placed_build_warp` and `_hardware`) builds with `ALLOW_UPDATE`, submits a placed `PERFORM_UPDATE` of the BLAS and TLAS through the resolver, and reads back a changed ray result with UAV barriers and a fence, compared with a direct update and a fresh build. The resolver refusal controls are kept, and an update of a source built without `ALLOW_UPDATE` is now refused as `source_not_updatable`. Details are in the PR body. Full merge order from our side: #1408, #1251, #1939, #1940, #1943, #2782, #2794, #2766.
SimSalabimse commented 2026-11-26 16:06:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-26T16:06:57Z.


Hardware result for head 5a79addf711b8934ee45a77906fd4be1be98f8ad: two NVIDIA tests fail on a check in tests/dxr_placed_build.h. WARP passes. Part of #870.

Environment: Windows 11 25H2 (26200), MSVC 19.42, dev preset, NVIDIA GeForce RTX 4070 Ti, driver 621.35 (32.0.16.2135), D3D12 debug layer enabled (0 errors, 0 warnings in the hardware runs). Tests run serially, one ctest process.

Command

ctest --preset dev --no-tests=error -R "dxr_placed_build|dxr_update|dxr_slot70" --output-on-failure

Result (measured): 6/8 passed.

  • Passed: dxr_placed_build_warp, dxr_slot70_as_warp, dxr_update_warp, dxr_update_pipeline_warp, dxr_update_hardware, dxr_update_pipeline_hardware.
  • Failed (about 0.3 s each): dxr_placed_build_hardware and dxr_slot70_as_hardware. dxr_placed_build_hardware failed on every one of 5 runs with the same message; dxr_slot70_as_hardware failed in the full run above (it uses the same scene).
x2w-dxr placed build refused: not_placed (dest at title 0x1000)
x2w-dxr placed build refused: unaligned (dest at title 0x...210)
DXR build refusal names the wrong cause (not_placed for destination in a buffer that is not an acceleration structure, expected wrong_state)
backend=hardware debug_layer=enabled
driver=32.0.16.2135
debug_errors=0 debug_warnings=0

On main at 7256cecf the same 8 tests pass (8/8, a clean build of that commit on the same machine). That tree does not have this control (must_reject(ts, tlas, Cause::wrong_state, ...), tests/dxr_placed_build.h:109), so this does not show a regression in the resolver, only that the new control does not hold on this adapter.

Where it fails (measured): the failing check passes the TLAS scratch buffer as the destination. I printed the sizes once in a throwaway local copy (not part of the PR):

TLAS ResultDataMaxSizeInBytes bytes left in the scratch buffer from ts
NVIDIA RTX 4070 Ti 2048 768
WARP 168 to 372 212 to 436

On WARP the TLAS result size fits in the scratch buffer. On NVIDIA it does not.

Likely cause (hypothesis, from reading the code): translate() in resolve_placed_build (d3d12_xs_device.cpp, around line 7092) calls placed_buffer_range(address, ResultDataMaxSizeInBytes) before it looks at the buffer's state. placed_buffer_range rejects a range that runs past the end of the buffer (d3d12_capture.inl, around line 330), so the destination is refused as not_placed and the wrong_state test is never reached. The scratch buffer is only 768 + scratch size bytes, which is smaller than the NVIDIA TLAS result. If that is right, the resolver refuses in the order it was written and the fixture's scratch buffer is too small for this adapter's sizes. I did not change or test the resolver itself.

Possible fix (tested only as a local patch): make the TLAS scratch buffer at least as large as the TLAS result, like the earlier change for big_as_:

-const auto ts = place(3, scratch_offset + scratch_bytes(top_size), scratch_state) + scratch_offset;
+const auto ts = place(3, scratch_offset + (std::max)(scratch_bytes(top_size), top_size.ResultDataMaxSizeInBytes), scratch_state) + scratch_offset;

With that one line, the same command gives 8/8 on this machine (hardware and WARP). The other must_reject controls that take a buffer as the destination may need the same care on other adapters.

This is one physical adapter on one driver. An AMD or Intel result would show whether the sizes differ per vendor.

AI-Assisted

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7197201695 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7197201695). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-26T16:06:57Z. --- Hardware result for head `5a79addf711b8934ee45a77906fd4be1be98f8ad`: two NVIDIA tests fail on a check in `tests/dxr_placed_build.h`. WARP passes. Part of #870. **Environment:** Windows 11 25H2 (26200), MSVC 19.42, `dev` preset, NVIDIA GeForce RTX 4070 Ti, driver 621.35 (32.0.16.2135), D3D12 debug layer enabled (0 errors, 0 warnings in the hardware runs). Tests run serially, one ctest process. **Command** ``` ctest --preset dev --no-tests=error -R "dxr_placed_build|dxr_update|dxr_slot70" --output-on-failure ``` **Result (measured):** 6/8 passed. - Passed: `dxr_placed_build_warp`, `dxr_slot70_as_warp`, `dxr_update_warp`, `dxr_update_pipeline_warp`, `dxr_update_hardware`, `dxr_update_pipeline_hardware`. - Failed (about 0.3 s each): `dxr_placed_build_hardware` and `dxr_slot70_as_hardware`. `dxr_placed_build_hardware` failed on every one of 5 runs with the same message; `dxr_slot70_as_hardware` failed in the full run above (it uses the same scene). ``` x2w-dxr placed build refused: not_placed (dest at title 0x1000) x2w-dxr placed build refused: unaligned (dest at title 0x...210) DXR build refusal names the wrong cause (not_placed for destination in a buffer that is not an acceleration structure, expected wrong_state) backend=hardware debug_layer=enabled driver=32.0.16.2135 debug_errors=0 debug_warnings=0 ``` On `main` at `7256cecf` the same 8 tests pass (8/8, a clean build of that commit on the same machine). That tree does not have this control (`must_reject(ts, tlas, Cause::wrong_state, ...)`, `tests/dxr_placed_build.h:109`), so this does not show a regression in the resolver, only that the new control does not hold on this adapter. **Where it fails (measured):** the failing check passes the TLAS scratch buffer as the destination. I printed the sizes once in a throwaway local copy (not part of the PR): | | TLAS `ResultDataMaxSizeInBytes` | bytes left in the scratch buffer from `ts` | |---|---|---| | NVIDIA RTX 4070 Ti | 2048 | 768 | | WARP | 168 to 372 | 212 to 436 | On WARP the TLAS result size fits in the scratch buffer. On NVIDIA it does not. **Likely cause (hypothesis, from reading the code):** `translate()` in `resolve_placed_build` (`d3d12_xs_device.cpp`, around line 7092) calls `placed_buffer_range(address, ResultDataMaxSizeInBytes)` before it looks at the buffer's state. `placed_buffer_range` rejects a range that runs past the end of the buffer (`d3d12_capture.inl`, around line 330), so the destination is refused as `not_placed` and the `wrong_state` test is never reached. The scratch buffer is only `768 + scratch size` bytes, which is smaller than the NVIDIA TLAS result. If that is right, the resolver refuses in the order it was written and the fixture's scratch buffer is too small for this adapter's sizes. I did not change or test the resolver itself. **Possible fix (tested only as a local patch):** make the TLAS scratch buffer at least as large as the TLAS result, like the earlier change for `big_as_`: ``` -const auto ts = place(3, scratch_offset + scratch_bytes(top_size), scratch_state) + scratch_offset; +const auto ts = place(3, scratch_offset + (std::max)(scratch_bytes(top_size), top_size.ResultDataMaxSizeInBytes), scratch_state) + scratch_offset; ``` With that one line, the same command gives 8/8 on this machine (hardware and WARP). The other must_reject controls that take a buffer as the destination may need the same care on other adapters. This is one physical adapter on one driver. An AMD or Intel result would show whether the sizes differ per vendor. AI-Assisted
tedin7 commented 2026-11-26 16:08:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T16:08:44Z.


@SimSalabimse thank you for running this on NVIDIA and for the careful write-up. The size table and the place where it fails make the cause clear: the wrong_state control uses the TLAS scratch buffer as the destination, and on your adapter that buffer is smaller than the TLAS result, so the resolver stops earlier with not_placed.

A fix is coming on this PR. It sizes the scratch buffer so the control reaches the state check on every adapter, along the lines you proposed. We will post the new head and the results here. A rerun of the same ctest command on your RTX 4070 Ti after that would be very welcome.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7197241676 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7197241676). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T16:08:44Z. --- @SimSalabimse thank you for running this on NVIDIA and for the careful write-up. The size table and the place where it fails make the cause clear: the `wrong_state` control uses the TLAS scratch buffer as the destination, and on your adapter that buffer is smaller than the TLAS result, so the resolver stops earlier with `not_placed`. A fix is coming on this PR. It sizes the scratch buffer so the control reaches the state check on every adapter, along the lines you proposed. We will post the new head and the results here. A rerun of the same `ctest` command on your RTX 4070 Ti after that would be very welcome. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 16:21:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T16:21:24Z.


@SimSalabimse the fix is on this PR now: head b09ac9ddb7085b09d704d12a230ef7eca3172087 (test-only change in tests/dxr_placed_build.h, no src/ change).

What changed: the decoy buffers in the fixture (the scratch buffer used as a destination in the wrong_state control, the scratch buffer behind the slot 70 view, and the buffer used as scratch) were sized to one device minimum. They are now sized from the device's own prebuild sizes, so on a GPU whose TLAS result is larger than its scratch the range check no longer fires first and each control reaches the cause it names.

Results on the new head:

  • Windows Server 2025, dev and release presets: dxr_placed_build_warp, dxr_placed_build_hardware, dxr_slot70_as_warp, dxr_slot70_as_hardware: 4/4 passed in each preset.
  • RTX 3090 through vkd3d-proton (Linux): dxr_placed_build_hardware failed on the old head 5a79addf7 with the same "expected wrong_state" message you saw, and passes on b09ac9ddb: 4/4.
  • CI on the new head: green.

Could you rerun the same command on your RTX 4070 Ti when you have a moment?

ctest --preset dev --no-tests=error -R "dxr_placed_build|dxr_update|dxr_slot70" --output-on-failure

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7197534018 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7197534018). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T16:21:24Z. --- @SimSalabimse the fix is on this PR now: head `b09ac9ddb7085b09d704d12a230ef7eca3172087` (test-only change in `tests/dxr_placed_build.h`, no `src/` change). What changed: the decoy buffers in the fixture (the scratch buffer used as a destination in the `wrong_state` control, the scratch buffer behind the slot 70 view, and the buffer used as scratch) were sized to one device minimum. They are now sized from the device's own prebuild sizes, so on a GPU whose TLAS result is larger than its scratch the range check no longer fires first and each control reaches the cause it names. Results on the new head: - Windows Server 2025, `dev` and `release` presets: `dxr_placed_build_warp`, `dxr_placed_build_hardware`, `dxr_slot70_as_warp`, `dxr_slot70_as_hardware`: 4/4 passed in each preset. - RTX 3090 through vkd3d-proton (Linux): `dxr_placed_build_hardware` failed on the old head `5a79addf7` with the same "expected wrong_state" message you saw, and passes on `b09ac9ddb`: 4/4. - CI on the new head: green. Could you rerun the same command on your RTX 4070 Ti when you have a moment? ``` ctest --preset dev --no-tests=error -R "dxr_placed_build|dxr_update|dxr_slot70" --output-on-failure ``` AI-assisted; commands listed were executed locally.
SimSalabimse commented 2026-11-26 18:18:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-26T18:18:55Z.


Rerun on head b09ac9ddb7085b09d704d12a230ef7eca3172087: all 8 pass on the RTX 4070 Ti, 3 runs out of 3.

Environment: same as before. Windows 11 25H2 (26200), MSVC 19.42, dev preset (incremental build of the earlier tree, fresh out/pe-env), NVIDIA GeForce RTX 4070 Ti, driver 621.35 (32.0.16.2135). Tests run serially.

Command

ctest --preset dev --no-tests=error -R "dxr_placed_build|dxr_update|dxr_slot70" --output-on-failure -j 1

Result (measured): 8/8 passed, ctest exit 0, in each of 3 runs. That includes dxr_placed_build_hardware and dxr_slot70_as_hardware, which failed on 5a79addf with expected wrong_state.

Negative control: the old head 5a79addf failed those two tests on this machine (my earlier comment), so the change in tests/dxr_placed_build.h is what makes them pass here.

AI-Assisted

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7200312919 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7200312919). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-26T18:18:55Z. --- Rerun on head `b09ac9ddb7085b09d704d12a230ef7eca3172087`: all 8 pass on the RTX 4070 Ti, 3 runs out of 3. **Environment:** same as before. Windows 11 25H2 (26200), MSVC 19.42, `dev` preset (incremental build of the earlier tree, fresh `out/pe-env`), NVIDIA GeForce RTX 4070 Ti, driver 621.35 (32.0.16.2135). Tests run serially. **Command** ``` ctest --preset dev --no-tests=error -R "dxr_placed_build|dxr_update|dxr_slot70" --output-on-failure -j 1 ``` **Result (measured):** 8/8 passed, ctest exit 0, in each of 3 runs. That includes `dxr_placed_build_hardware` and `dxr_slot70_as_hardware`, which failed on `5a79addf` with `expected wrong_state`. Negative control: the old head `5a79addf` failed those two tests on this machine (my earlier comment), so the change in `tests/dxr_placed_build.h` is what makes them pass here. AI-Assisted
tedin7 commented 2026-11-26 18:28:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T18:28:18Z.


@SimSalabimse thank you for the rerun and for the negative control on the old head. 8/8 on the RTX 4070 Ti, 3 runs out of 3, confirms the fixture fix on b09ac9ddb on a second NVIDIA adapter. No further change is planned on this PR; it is waiting for maintainer review.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7200500192 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7200500192). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T18:28:18Z. --- @SimSalabimse thank you for the rerun and for the negative control on the old head. 8/8 on the RTX 4070 Ti, 3 runs out of 3, confirms the fixture fix on `b09ac9ddb` on a second NVIDIA adapter. No further change is planned on this PR; it is waiting for maintainer review. AI-assisted; commands listed were executed locally.
pigalot commented 2026-11-27 22:16:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T22:16:23Z.

Review: APPROVED


Independently reviewed b09ac9dd integrated over main 5612e924 (tree 2fa7dbce). The merge is clean (CMakeLists.txt, docs/experiments.md and src/startup_stubs/d3d12_xs_device.cpp auto-merged) and git diff --cached --check origin/main is clean.

Earlier findings (R0Y00, changes requested on 9e8d04df): addressed.

  • Build with ALLOW_UPDATE, submit an update through the placed path, read back a changed ray result. check_placed_update (called from check_dxr_placed_build) does this:
    • It builds the placed BLAS and TLAS with ALLOW_UPDATE and resolves an in-place PERFORM_UPDATE of both through resolve_placed_build, from the title addresses of the initial build.
    • It traces after the existing UAV barriers and fence.
    • It requires the hit instance IDs to change from 7, 11, 0, 0 to 0, 0, 7, 11, and the rows to equal both the direct-address update and a fresh placed build of the updated scene.
    • On this machine it prints ray results changed and equal the direct-address update and a fresh placed build on both WARP and hardware.
  • Keep the resolver refusal controls. The three original must_reject calls are still there: the unmapped destination, the short scratch, and the swapped states. Each now also has to name its cause, and four new destination and scratch controls sit next to them.
  • Document the precondition, or reject when provenance can be tracked. It takes the second option. PlacedBuildLedger records the ALLOW_UPDATE flag of each build the resolver publishes, and an update is refused when its source was never built (source_not_built) or was built without the flag (source_not_updatable). The provenance check and the record happen under one SRW lock, after every lookup, so a refused call records nothing. The geometry-layout precondition that remains is stated in docs/experiments.md.

What I traced. In resolve_placed_build the update shape is checked before any lookup. The cases are:

  • PERFORM_UPDATE without a source, and a source without PERFORM_UPDATE;
  • an unaligned source;
  • a source that partly overlaps the destination (in-place updates are still allowed).

The source then goes through the same placement lookup as the destination, with its causes renamed source_*. An update's scratch is sized by UpdateScratchDataSizeInBytes. When that size is 0 (as WARP reports), a null scratch is accepted, and a scratch that is passed must still be a placed UAV buffer, checked over one byte. On success the source is rewritten to its desktop GPU address. On refusal the descriptor is left as the caller gave it, which the fixture checks for the destination, the scratch and the source. The other caller, tests/cpu/placed_dxr_provider.cpp, keeps the default nullptr cause.

What I ran.

. .\tools\dev.ps1; cmake --preset <preset>
cmake --build --preset <preset> --target placed_build_causes_check offscreen_check cpu_placed_dxr_provider cpu_placed_dxr cpu_placed_dxr_lifted pe_map cpu_exe_io
$r = '^(placed_build_causes|dxr_placed_build_(warp|hardware)|dxr_slot70_as_(warp|hardware)|dxr_update_(warp|hardware)|dxr_update_pipeline_(warp|hardware)|cpu_placed_dxr_(warp|hardware))$'
ctest --test-dir out/build/<preset> --no-tests=error -j 4 -R $r -E '_hardware$'
python with_gpu_lock.py ctest --test-dir out/build/<preset> --no-tests=error -j 1 -V -R $r -E '_warp$|^placed_build_causes$'
  • Results: 11/11 pass in dev and in release /O2, with no skips. That is placed_build_causes, five WARP tests and five hardware tests, with debug_layer=enabled on the hardware runs. In both presets, dxr_placed_build_hardware and dxr_slot70_as_hardware log each named refusal once, from not_placed through source_not_updatable.
  • Release setup note. A first release pass failed both cpu_placed_dxr_* tests with FileNotFoundError ... cpu_placed_dxr_lifted.exe. That was my targeted build missing that test's other targets. Both pass once cpu_placed_dxr, cpu_placed_dxr_lifted, pe_map and cpu_exe_io are built.
  • Before: on main 5612e924, placed_build_causes is not registered, and the resolver returns E_INVALIDARG for any source or PERFORM_UPDATE.

Mutants (each applied alone, the target rebuilt in dev, file restored from its raw bytes, git diff --quiet clean afterwards). Every one is killed:

Mutant Test First failure
ledger ignores the ALLOW_UPDATE flag placed_build_causes ledger.check_source(base + 8 * size) == Cause::source_not_updatable
a build does not replace overlapping records placed_build_causes ledger.check_source(base) == Cause::source_not_built
partial-overlap rule removed placed_build_causes check_update_shape(true, base + 256, base, size) == Cause::source_dest_partial_overlap
last_byte one past the end placed_build_causes check_update_shape(true, base, base + size, size) == Cause::ok
translated-address alignment not checked placed_build_causes gpu_range_cause(gpu, 1) == Cause::range
provenance check skipped dxr_placed_build_warp Invalid DXR update was accepted or partially published: source never built
every build recorded as ALLOW_UPDATE dxr_placed_build_warp … source built without ALLOW_UPDATE
null update scratch refused dxr_placed_build_warp Resolve update without scratch failed (HRESULT 0x80070057)
update sized by the build scratch dxr_placed_build_warp same
source address not translated dxr_placed_build_warp An in-place update must translate source and destination to the same address

Non-blocking notes.

  • The ledger is never told when a placed buffer is released. Entries for freed memory stay until a later build overlaps them, so a reused title address keeps the old flags until then. A title that updates a structure it never rebuilt at that address is already invalid, so I don't think this changes any valid sequence. Clearing the overlapping records when a placed buffer is destroyed would bound the ledger's size and remove the stale case.
  • The comment on PlacedBuildScene::resolve_update still says "The caller keeps ALLOW_UPDATE from the initial build; the resolver cannot see it." Since 3bdbf41c the resolver records the flag and refuses a source built without it.
  • Out-of-place updates are resolved and checked by address but not dispatched, as the body states.

Verdict: approve on b09ac9dd.

Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088, Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Python 3.12.10, D3D12 debug layer enabled for the hardware runs.
CI: Build and test on Windows, Assemble and translate gfx1013 fixtures and Run platform-independent Python checks on Linux pass on b09ac9dd.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6093864089 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#pullrequestreview-6093864089). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-27T22:16:23Z. **Review:** APPROVED --- Independently reviewed `b09ac9dd` integrated over `main` `5612e924` (tree `2fa7dbce`). The merge is clean (`CMakeLists.txt`, `docs/experiments.md` and `src/startup_stubs/d3d12_xs_device.cpp` auto-merged) and `git diff --cached --check origin/main` is clean. **Earlier findings (R0Y00, changes requested on `9e8d04df`): addressed.** - *Build with `ALLOW_UPDATE`, submit an update through the placed path, read back a changed ray result.* `check_placed_update` (called from `check_dxr_placed_build`) does this: - It builds the placed BLAS and TLAS with `ALLOW_UPDATE` and resolves an in-place `PERFORM_UPDATE` of both through `resolve_placed_build`, from the title addresses of the initial build. - It traces after the existing UAV barriers and fence. - It requires the hit instance IDs to change from 7, 11, 0, 0 to 0, 0, 7, 11, and the rows to equal both the direct-address update and a fresh placed build of the updated scene. - On this machine it prints `ray results changed and equal the direct-address update and a fresh placed build` on both WARP and hardware. - *Keep the resolver refusal controls.* The three original `must_reject` calls are still there: the unmapped destination, the short scratch, and the swapped states. Each now also has to name its cause, and four new destination and scratch controls sit next to them. - *Document the precondition, or reject when provenance can be tracked.* It takes the second option. `PlacedBuildLedger` records the `ALLOW_UPDATE` flag of each build the resolver publishes, and an update is refused when its source was never built (`source_not_built`) or was built without the flag (`source_not_updatable`). The provenance check and the record happen under one SRW lock, after every lookup, so a refused call records nothing. The geometry-layout precondition that remains is stated in `docs/experiments.md`. **What I traced.** In `resolve_placed_build` the update shape is checked before any lookup. The cases are: - `PERFORM_UPDATE` without a source, and a source without `PERFORM_UPDATE`; - an unaligned source; - a source that partly overlaps the destination (in-place updates are still allowed). The source then goes through the same placement lookup as the destination, with its causes renamed `source_*`. An update's scratch is sized by `UpdateScratchDataSizeInBytes`. When that size is 0 (as WARP reports), a null scratch is accepted, and a scratch that is passed must still be a placed UAV buffer, checked over one byte. On success the source is rewritten to its desktop GPU address. On refusal the descriptor is left as the caller gave it, which the fixture checks for the destination, the scratch and the source. The other caller, `tests/cpu/placed_dxr_provider.cpp`, keeps the default `nullptr` cause. **What I ran.** ```powershell . .\tools\dev.ps1; cmake --preset <preset> cmake --build --preset <preset> --target placed_build_causes_check offscreen_check cpu_placed_dxr_provider cpu_placed_dxr cpu_placed_dxr_lifted pe_map cpu_exe_io $r = '^(placed_build_causes|dxr_placed_build_(warp|hardware)|dxr_slot70_as_(warp|hardware)|dxr_update_(warp|hardware)|dxr_update_pipeline_(warp|hardware)|cpu_placed_dxr_(warp|hardware))$' ctest --test-dir out/build/<preset> --no-tests=error -j 4 -R $r -E '_hardware$' python with_gpu_lock.py ctest --test-dir out/build/<preset> --no-tests=error -j 1 -V -R $r -E '_warp$|^placed_build_causes$' ``` - **Results:** 11/11 pass in `dev` and in `release` `/O2`, with no skips. That is `placed_build_causes`, five WARP tests and five hardware tests, with `debug_layer=enabled` on the hardware runs. In both presets, `dxr_placed_build_hardware` and `dxr_slot70_as_hardware` log each named refusal once, from `not_placed` through `source_not_updatable`. - **Release setup note.** A first `release` pass failed both `cpu_placed_dxr_*` tests with `FileNotFoundError ... cpu_placed_dxr_lifted.exe`. That was my targeted build missing that test's other targets. Both pass once `cpu_placed_dxr`, `cpu_placed_dxr_lifted`, `pe_map` and `cpu_exe_io` are built. - **Before:** on `main` `5612e924`, `placed_build_causes` is not registered, and the resolver returns `E_INVALIDARG` for any source or `PERFORM_UPDATE`. **Mutants** (each applied alone, the target rebuilt in `dev`, file restored from its raw bytes, `git diff --quiet` clean afterwards). Every one is killed: | Mutant | Test | First failure | |---|---|---| | ledger ignores the `ALLOW_UPDATE` flag | `placed_build_causes` | `ledger.check_source(base + 8 * size) == Cause::source_not_updatable` | | a build does not replace overlapping records | `placed_build_causes` | `ledger.check_source(base) == Cause::source_not_built` | | partial-overlap rule removed | `placed_build_causes` | `check_update_shape(true, base + 256, base, size) == Cause::source_dest_partial_overlap` | | `last_byte` one past the end | `placed_build_causes` | `check_update_shape(true, base, base + size, size) == Cause::ok` | | translated-address alignment not checked | `placed_build_causes` | `gpu_range_cause(gpu, 1) == Cause::range` | | provenance check skipped | `dxr_placed_build_warp` | `Invalid DXR update was accepted or partially published: source never built` | | every build recorded as `ALLOW_UPDATE` | `dxr_placed_build_warp` | `… source built without ALLOW_UPDATE` | | null update scratch refused | `dxr_placed_build_warp` | `Resolve update without scratch failed (HRESULT 0x80070057)` | | update sized by the build scratch | `dxr_placed_build_warp` | same | | source address not translated | `dxr_placed_build_warp` | `An in-place update must translate source and destination to the same address` | **Non-blocking notes.** - The ledger is never told when a placed buffer is released. Entries for freed memory stay until a later build overlaps them, so a reused title address keeps the old flags until then. A title that updates a structure it never rebuilt at that address is already invalid, so I don't think this changes any valid sequence. Clearing the overlapping records when a placed buffer is destroyed would bound the ledger's size and remove the stale case. - The comment on `PlacedBuildScene::resolve_update` still says "The caller keeps ALLOW_UPDATE from the initial build; the resolver cannot see it." Since `3bdbf41c` the resolver records the flag and refuses a source built without it. - Out-of-place updates are resolved and checked by address but not dispatched, as the body states. **Verdict:** approve on `b09ac9dd`. Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088, Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Python 3.12.10, D3D12 debug layer enabled for the hardware runs. CI: `Build and test on Windows`, `Assemble and translate gfx1013 fixtures` and `Run platform-independent Python checks on Linux` pass on `b09ac9dd`. This reply was AI-assisted.
JohnConnorNPC commented 2026-11-28 08:10:29 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-28T08:10:29Z.


Thanks for this. I reviewed head b09ac9dd and found nothing blocking. It looks ready to merge from our side, with one suggestion and some nits below. The review decision is still CHANGES_REQUESTED, so it needs R0Y00's re-review before it can merge. This was a static review plus a g++ build of the device-free check on Linux. I did no Windows build and no WARP or GPU run.

  • Merge: git merge-tree --write-tree 1f07b2c1 b09ac9dd against current main returns rc=0 (tree b3607ea4).
  • Requested changes (R0Y00's review on 9e8d04df): all five are on the head. The source is built with ALLOW_UPDATE. The update goes through resolve_update and then BuildRaytracingAccelerationStructure. check_placed_update requires the result to change and to match both the direct and the fresh build. The three original must_reject controls remain, each with its cause. The ledger gives source_not_built and source_not_updatable. pigalot approved b09ac9dd, and SimSalabimse's 8/8 on an RTX 4070 Ti is at this head (the earlier head failed).
  • On the merge tree, g++ -std=c++17 -O2 -Wall -Wextra -fsanitize=address,undefined -Isrc tests/placed_build_causes_check.cpp builds with 0 warnings and prints placed build causes: all checks passed. Nine mutants of placed_build.h all fail. They include dropping the partial-overlap rule, ignoring allow_update, accepting an interior source address and removing the UINT64_MAX clamp in last_byte.
  • CI passed, but ctest --preset pr ran 40 tests, and grep -c on the Windows job log finds 0 runs of placed_build_causes or dxr_placed_build. So far the new tests have run only locally.

Suggestion (not blocking):

  1. The device control "source one stride past the destination" gets its expected cause from check_update_shape(true, tlas + 256, tlas, ...), the same function the resolver calls. Its source range runs past the end of buffer 1 (place(1, dest_offset + top_size.ResultDataMaxSizeInBytes, ...)). With the overlap rule removed, the expectation and the resolver both give source_not_placed, so the test stays green. To pin the rule on a device, use sizes with ResultDataMaxSizeInBytes >= 512 and expect the literal Cause::source_dest_partial_overlap.

Nits:
2. In tests/dxr_placed_build.h, the resolve_update comment still says of ALLOW_UPDATE that "the resolver cannot see it", but the resolver now records it.
3. Nothing clears the static ledger in resolve_placed_build when a placement is retired, and record() scans every entry on each build. This is fine for the tests, but it should be bounded before a wider path calls it.
4. (std::max<UINT64>)(scratch_bytes, 1) also applies to full builds. A full build with ScratchDataSizeInBytes == 0 was refused before and is now accepted. The comment above it covers only updates, and no test covers a full build.
5. placed_build_causes needs no device, but it is not in the pr preset (grep -c placed_build_causes CMakePresets.json gives 0), so CI never runs it.
6. Seven of the 11 commits have a c1 author that links to no GitHub account. A squash merge would fix that.

This comment was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7236411274 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7236411274). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-28T08:10:29Z. --- Thanks for this. I reviewed head `b09ac9dd` and found nothing blocking. It looks ready to merge from our side, with one suggestion and some nits below. The review decision is still CHANGES_REQUESTED, so it needs R0Y00's re-review before it can merge. This was a static review plus a g++ build of the device-free check on Linux. I did no Windows build and no WARP or GPU run. - Merge: `git merge-tree --write-tree 1f07b2c1 b09ac9dd` against current `main` returns rc=0 (tree `b3607ea4`). - Requested changes (R0Y00's review on `9e8d04df`): all five are on the head. The source is built with `ALLOW_UPDATE`. The update goes through `resolve_update` and then `BuildRaytracingAccelerationStructure`. `check_placed_update` requires the result to change and to match both the direct and the fresh build. The three original `must_reject` controls remain, each with its cause. The ledger gives `source_not_built` and `source_not_updatable`. pigalot approved `b09ac9dd`, and SimSalabimse's 8/8 on an RTX 4070 Ti is at this head (the earlier head failed). - On the merge tree, `g++ -std=c++17 -O2 -Wall -Wextra -fsanitize=address,undefined -Isrc tests/placed_build_causes_check.cpp` builds with 0 warnings and prints `placed build causes: all checks passed`. Nine mutants of `placed_build.h` all fail. They include dropping the partial-overlap rule, ignoring `allow_update`, accepting an interior source address and removing the `UINT64_MAX` clamp in `last_byte`. - CI passed, but `ctest --preset pr` ran 40 tests, and `grep -c` on the Windows job log finds 0 runs of `placed_build_causes` or `dxr_placed_build`. So far the new tests have run only locally. Suggestion (not blocking): 1. The device control "source one stride past the destination" gets its expected cause from `check_update_shape(true, tlas + 256, tlas, ...)`, the same function the resolver calls. Its source range runs past the end of buffer 1 (`place(1, dest_offset + top_size.ResultDataMaxSizeInBytes, ...)`). With the overlap rule removed, the expectation and the resolver both give `source_not_placed`, so the test stays green. To pin the rule on a device, use sizes with `ResultDataMaxSizeInBytes >= 512` and expect the literal `Cause::source_dest_partial_overlap`. Nits: 2. In tests/dxr_placed_build.h, the `resolve_update` comment still says of `ALLOW_UPDATE` that "the resolver cannot see it", but the resolver now records it. 3. Nothing clears the static ledger in `resolve_placed_build` when a placement is retired, and `record()` scans every entry on each build. This is fine for the tests, but it should be bounded before a wider path calls it. 4. `(std::max<UINT64>)(scratch_bytes, 1)` also applies to full builds. A full build with `ScratchDataSizeInBytes == 0` was refused before and is now accepted. The comment above it covers only updates, and no test covers a full build. 5. `placed_build_causes` needs no device, but it is not in the `pr` preset (`grep -c placed_build_causes CMakePresets.json` gives 0), so CI never runs it. 6. Seven of the 11 commits have a `c1` author that links to no GitHub account. A squash merge would fix that. This comment was AI-assisted.
tedin7 commented 2026-11-28 21:53:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T21:53:57Z.


Thanks @JohnConnorNPC. Pushed f86463097 (origin/main merged with a merge commit, no force push).

What changed:

  • Nit 2 fixed: the resolve_update comment in tests/dxr_placed_build.h no longer says the resolver cannot see ALLOW_UPDATE; it records it and refuses the update without it.
  • Suggestion 1 (literal source_dest_partial_overlap on a device): not changed. The overlap rule is pinned by value in placed_build_causes_check (the partial-overlap mutant fails there), and the device control accepts either cause on purpose because the prebuild size, and so the buffer layout, belongs to the adapter. Pinning it on a device would need a fixture buffer larger than the adapter's structure size; say if you want that as a follow-up.
  • Nit 3 (ledger growth): entries are keyed by structure start, and a build over the same memory replaces what it overlaps, so the ledger holds at most one entry per distinct live placement. Left as is.

Verification (Windows Server 2025, D3D12 WARP, PR head f86463097, dev and release):
x2w_pipe.py win2025 1943 --regex '^(placed_build_causes|dxr_placed_build_|dxr_slot70_as_|dxr_update)' -> 9/9 passed in both legs.

@MasterDomino this one is ready for a re-review and merge when you have time. The old changes-requested review by @R0Y00 was answered earlier in this thread (update path through resolve_update, ALLOW_UPDATE provenance) and approved by pigalot.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7246353505 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7246353505). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-28T21:53:57Z. --- Thanks @JohnConnorNPC. Pushed `f86463097` (origin/main merged with a merge commit, no force push). What changed: - Nit 2 fixed: the `resolve_update` comment in `tests/dxr_placed_build.h` no longer says the resolver cannot see `ALLOW_UPDATE`; it records it and refuses the update without it. - Suggestion 1 (literal `source_dest_partial_overlap` on a device): not changed. The overlap rule is pinned by value in `placed_build_causes_check` (the partial-overlap mutant fails there), and the device control accepts either cause on purpose because the prebuild size, and so the buffer layout, belongs to the adapter. Pinning it on a device would need a fixture buffer larger than the adapter's structure size; say if you want that as a follow-up. - Nit 3 (ledger growth): entries are keyed by structure start, and a build over the same memory replaces what it overlaps, so the ledger holds at most one entry per distinct live placement. Left as is. Verification (Windows Server 2025, D3D12 WARP, PR head `f86463097`, dev and release): `x2w_pipe.py win2025 1943 --regex '^(placed_build_causes|dxr_placed_build_|dxr_slot70_as_|dxr_update)'` -> 9/9 passed in both legs. @MasterDomino this one is ready for a re-review and merge when you have time. The old changes-requested review by @R0Y00 was answered earlier in this thread (update path through `resolve_update`, `ALLOW_UPDATE` provenance) and approved by pigalot. AI-assisted; commands listed were executed locally.
pigalot commented 2026-11-29 06:25:27 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-29T06:25:27Z.

Review: COMMENTED


Retested f8646309 integrated over main 212d4b5f (tree 570ff438). The merge is clean and git diff --cached --check origin/main is clean. I am not carrying my approval of b09ac9dd over to this head yet; the reason is the real-title run below, not the code I read.

What changed since b09ac9dd.

  • 60748f14 merges main 8ecd30fe into the branch. git show --remerge-diff 60748f14 is empty, so nothing was resolved by hand.
  • f8646309 rewrites one comment on PlacedBuildScene::resolve_update in tests/dxr_placed_build.h. That was the stale-comment note in my last review; it is addressed.
  • I compared the PR's own diff at both heads (merge-base..b09ac9dd against 8ecd30fe..f8646309): that comment line is the only difference.
  • main has not changed placed_build.h, tests/dxr_check.cpp, tests/dxr_placed_build.h or tests/cpu/placed_dxr_provider.cpp since my last review, and placed_buffer_range still has the signature the resolver uses.

Earlier findings. R0Y00's three requests on 9e8d04df (update through the placed path with a changed ray result, keep the refusal controls, track or document ALLOW_UPDATE provenance) were addressed at b09ac9dd as I described in my last review, and the code that addresses them is unchanged here. My other two notes (ledger entries are not cleared when a placed buffer is released; out-of-place updates are resolved but not dispatched) stand as non-blocking.

What I ran.

. .\tools\dev.ps1; cmake --preset <preset>
cmake --build --preset <preset> --target placed_build_causes_check offscreen_check cpu_placed_dxr_provider cpu_placed_dxr cpu_placed_dxr_lifted pe_map cpu_exe_io
$r = '^(placed_build_causes|dxr_placed_build_(warp|hardware)|dxr_slot70_as_(warp|hardware)|dxr_update_(warp|hardware)|dxr_update_pipeline_(warp|hardware)|cpu_placed_dxr_(warp|hardware))$'
ctest --test-dir out/build/<preset> --no-tests=error -j 4 -R $r -E '_hardware$'
python with_gpu_lock.py ctest --test-dir out/build/<preset> --no-tests=error -j 1 -V -R $r -E '_warp$|^placed_build_causes$'
  • 11/11 pass in dev and in release /O2, with no skips: placed_build_causes, five WARP tests and five hardware tests. The hardware runs report debug_layer=enabled and debug_errors=0 debug_warnings=0.
  • In both presets dxr_placed_build_hardware and dxr_slot70_as_hardware log each named refusal once, from not_placed to source_not_updatable, and dxr_placed_build_hardware prints ray results changed and equal the direct-address update and a fresh placed build.

Mutants (each applied alone in dev, the target rebuilt, the file restored from its raw bytes, git diff --quiet clean afterwards). 10 killed, 0 surviving, 0 equivalent.

Mutant Test First failure
ledger ignores the ALLOW_UPDATE flag placed_build_causes placed_build_causes_check.cpp:122 ledger.check_source(base + 8 * size) == Cause::source_not_updatable
a build does not replace overlapping records placed_build_causes :132 ledger.check_source(base) == Cause::source_not_built
partial-overlap rule removed placed_build_causes :57 check_update_shape(true, base + 256, base, size) == Cause::source_dest_partial_overlap
last_byte one past the end placed_build_causes :50 check_update_shape(true, base, base + size, size) == Cause::ok
translated-address alignment not checked placed_build_causes :104 gpu_range_cause(gpu, 1) == Cause::range
provenance check skipped dxr_placed_build_warp Invalid DXR update was accepted or partially published: source never built
every build recorded as ALLOW_UPDATE dxr_placed_build_warp ... source built without ALLOW_UPDATE
null update scratch refused dxr_placed_build_warp Resolve update without scratch failed (HRESULT 0x80070057)
update sized by the build scratch dxr_placed_build_warp same
source address not translated dxr_placed_build_warp An in-place update must translate source and destination to the same address

Real-title run (why this is a comment and not an approval). A local startup run of a real title with a scripted input plan, compared against the same run of main 212d4b5f:

  • f8646309 (the PR head): [fail] frames_present: 12 of 12 checkpoint frames captured, 8 black (baseline: 0 black).
  • f8646309 merged over main 212d4b5f (the trial merge above): the same line, 8 black.
  • 8ecd30fe (the main commit this branch last merged, without the PR): [pass] frames_present: 12 of 12 checkpoint frames captured, 0 black (baseline: 0 black).
  • In all four runs the input plan finished and input_response passed, 4 of 4.

So two runs that contain this PR show black frames, and two runs without it do not. I cannot explain that from the code: resolve_placed_build has no caller under src/ (its only callers are tests/dxr_placed_build.h and tests/cpu/placed_dxr_provider.cpp), and the rest of the diff is the header, tests, one CMake test target and docs. Four runs do not rule out run-to-run variation, and I have not shown that it is one. I have queued one more run of each side (main 212d4b5f, and the trial merge); they had not run when I posted this.

I am not asking for a code change: I have no reproducible input to give you, and nothing in the diff that I can point at. Until the black frames are either explained or shown to vary between runs of the same commit, I am leaving this head unapproved.

Not rerun at this head. JohnConnorNPC's suggestion (the device control for a source one stride past the destination takes its expected cause from check_update_shape, so it cannot pin the overlap rule on a device) is answered by the author as intended. The device-free check does pin that rule (third mutant above). I did not run the overlap mutant against the device tests.

Verdict: comment on f8646309. Code and tests are as I approved them at b09ac9dd; the title-run difference is open. R0Y00's changes request from 9e8d04df is still the review decision on the PR.

Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088, Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Python 3.12.10, D3D12 debug layer enabled for the hardware runs.
CI: Build and test on Windows, Assemble and translate gfx1013 fixtures and Run platform-independent Python checks on Linux pass on f8646309.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6101743302 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#pullrequestreview-6101743302). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-29T06:25:27Z. **Review:** COMMENTED --- Retested `f8646309` integrated over `main` `212d4b5f` (tree `570ff438`). The merge is clean and `git diff --cached --check origin/main` is clean. I am not carrying my approval of `b09ac9dd` over to this head yet; the reason is the real-title run below, not the code I read. **What changed since `b09ac9dd`.** - `60748f14` merges `main` `8ecd30fe` into the branch. `git show --remerge-diff 60748f14` is empty, so nothing was resolved by hand. - `f8646309` rewrites one comment on `PlacedBuildScene::resolve_update` in `tests/dxr_placed_build.h`. That was the stale-comment note in my last review; it is addressed. - I compared the PR's own diff at both heads (`merge-base..b09ac9dd` against `8ecd30fe..f8646309`): that comment line is the only difference. - `main` has not changed `placed_build.h`, `tests/dxr_check.cpp`, `tests/dxr_placed_build.h` or `tests/cpu/placed_dxr_provider.cpp` since my last review, and `placed_buffer_range` still has the signature the resolver uses. **Earlier findings.** R0Y00's three requests on `9e8d04df` (update through the placed path with a changed ray result, keep the refusal controls, track or document `ALLOW_UPDATE` provenance) were addressed at `b09ac9dd` as I described in my last review, and the code that addresses them is unchanged here. My other two notes (ledger entries are not cleared when a placed buffer is released; out-of-place updates are resolved but not dispatched) stand as non-blocking. **What I ran.** ```powershell . .\tools\dev.ps1; cmake --preset <preset> cmake --build --preset <preset> --target placed_build_causes_check offscreen_check cpu_placed_dxr_provider cpu_placed_dxr cpu_placed_dxr_lifted pe_map cpu_exe_io $r = '^(placed_build_causes|dxr_placed_build_(warp|hardware)|dxr_slot70_as_(warp|hardware)|dxr_update_(warp|hardware)|dxr_update_pipeline_(warp|hardware)|cpu_placed_dxr_(warp|hardware))$' ctest --test-dir out/build/<preset> --no-tests=error -j 4 -R $r -E '_hardware$' python with_gpu_lock.py ctest --test-dir out/build/<preset> --no-tests=error -j 1 -V -R $r -E '_warp$|^placed_build_causes$' ``` - 11/11 pass in `dev` and in `release` `/O2`, with no skips: `placed_build_causes`, five WARP tests and five hardware tests. The hardware runs report `debug_layer=enabled` and `debug_errors=0 debug_warnings=0`. - In both presets `dxr_placed_build_hardware` and `dxr_slot70_as_hardware` log each named refusal once, from `not_placed` to `source_not_updatable`, and `dxr_placed_build_hardware` prints `ray results changed and equal the direct-address update and a fresh placed build`. **Mutants** (each applied alone in `dev`, the target rebuilt, the file restored from its raw bytes, `git diff --quiet` clean afterwards). 10 killed, 0 surviving, 0 equivalent. | Mutant | Test | First failure | |---|---|---| | ledger ignores the `ALLOW_UPDATE` flag | `placed_build_causes` | `placed_build_causes_check.cpp:122` `ledger.check_source(base + 8 * size) == Cause::source_not_updatable` | | a build does not replace overlapping records | `placed_build_causes` | `:132` `ledger.check_source(base) == Cause::source_not_built` | | partial-overlap rule removed | `placed_build_causes` | `:57` `check_update_shape(true, base + 256, base, size) == Cause::source_dest_partial_overlap` | | `last_byte` one past the end | `placed_build_causes` | `:50` `check_update_shape(true, base, base + size, size) == Cause::ok` | | translated-address alignment not checked | `placed_build_causes` | `:104` `gpu_range_cause(gpu, 1) == Cause::range` | | provenance check skipped | `dxr_placed_build_warp` | `Invalid DXR update was accepted or partially published: source never built` | | every build recorded as `ALLOW_UPDATE` | `dxr_placed_build_warp` | `... source built without ALLOW_UPDATE` | | null update scratch refused | `dxr_placed_build_warp` | `Resolve update without scratch failed (HRESULT 0x80070057)` | | update sized by the build scratch | `dxr_placed_build_warp` | same | | source address not translated | `dxr_placed_build_warp` | `An in-place update must translate source and destination to the same address` | **Real-title run (why this is a comment and not an approval).** A local startup run of a real title with a scripted input plan, compared against the same run of `main` `212d4b5f`: - `f8646309` (the PR head): `[fail] frames_present: 12 of 12 checkpoint frames captured, 8 black (baseline: 0 black).` - `f8646309` merged over `main` `212d4b5f` (the trial merge above): the same line, 8 black. - `8ecd30fe` (the `main` commit this branch last merged, without the PR): `[pass] frames_present: 12 of 12 checkpoint frames captured, 0 black (baseline: 0 black).` - In all four runs the input plan finished and `input_response` passed, 4 of 4. So two runs that contain this PR show black frames, and two runs without it do not. I cannot explain that from the code: `resolve_placed_build` has no caller under `src/` (its only callers are `tests/dxr_placed_build.h` and `tests/cpu/placed_dxr_provider.cpp`), and the rest of the diff is the header, tests, one CMake test target and docs. Four runs do not rule out run-to-run variation, and I have not shown that it is one. I have queued one more run of each side (`main` `212d4b5f`, and the trial merge); they had not run when I posted this. I am not asking for a code change: I have no reproducible input to give you, and nothing in the diff that I can point at. Until the black frames are either explained or shown to vary between runs of the same commit, I am leaving this head unapproved. **Not rerun at this head.** JohnConnorNPC's suggestion (the device control for a source one stride past the destination takes its expected cause from `check_update_shape`, so it cannot pin the overlap rule on a device) is answered by the author as intended. The device-free check does pin that rule (third mutant above). I did not run the overlap mutant against the device tests. **Verdict:** comment on `f8646309`. Code and tests are as I approved them at `b09ac9dd`; the title-run difference is open. R0Y00's changes request from `9e8d04df` is still the review decision on the PR. Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088, Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Python 3.12.10, D3D12 debug layer enabled for the hardware runs. CI: `Build and test on Windows`, `Assemble and translate gfx1013 fixtures` and `Run platform-independent Python checks on Linux` pass on `f8646309`. This reply was AI-assisted.
JohnConnorNPC commented 2026-11-29 12:48:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T12:48:52Z.


I re-checked f8646309 against main 77d1ba4d. The trial merge is clean: git merge-tree --write-tree origin/main f8646309 exits 0. I compared the PR's own diff at both heads (git diff <merge-base> b09ac9dd against git diff 8ecd30fe f8646309). The only difference is the resolve_update comment, so my earlier review stands: nothing blocking from me. Thanks for fixing the comment and for answering the other points.

Two small points from that review are still open. Both are optional:

NIT

  1. placed_build_causes is device-free but still isn't in the pr preset. git show f8646309:CMakePresets.json | grep -c placed_build_causes gives 0, so CI doesn't run the check that pins the overlap rule.
  2. (std::max<UINT64>)(scratch_bytes, 1) also applies to full builds. A full build whose ScratchDataSizeInBytes is 0 is now accepted when its scratch address is a placed buffer, where before it was refused. Only the update case is commented.

About pigalot's black-frame runs: git grep -n resolve_placed_build f8646309 -- src finds only the definition and the declaration, so nothing in the runtime calls it. Its ledger and lock are function-local statics. placed_build.h adds no namespace-scope objects, so loading the DLL doesn't construct anything new either.

R0Y00's change request on 9e8d04df is still the review decision, so the merge is blocked until R0Y00 re-reviews.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7256082111 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7256082111). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-29T12:48:52Z. --- I re-checked `f8646309` against `main` `77d1ba4d`. The trial merge is clean: `git merge-tree --write-tree origin/main f8646309` exits 0. I compared the PR's own diff at both heads (`git diff <merge-base> b09ac9dd` against `git diff 8ecd30fe f8646309`). The only difference is the `resolve_update` comment, so my earlier review stands: nothing blocking from me. Thanks for fixing the comment and for answering the other points. Two small points from that review are still open. Both are optional: **NIT** 1. `placed_build_causes` is device-free but still isn't in the `pr` preset. `git show f8646309:CMakePresets.json | grep -c placed_build_causes` gives `0`, so CI doesn't run the check that pins the overlap rule. 2. `(std::max<UINT64>)(scratch_bytes, 1)` also applies to full builds. A full build whose `ScratchDataSizeInBytes` is 0 is now accepted when its scratch address is a placed buffer, where before it was refused. Only the update case is commented. About pigalot's black-frame runs: `git grep -n resolve_placed_build f8646309 -- src` finds only the definition and the declaration, so nothing in the runtime calls it. Its ledger and lock are function-local statics. `placed_build.h` adds no namespace-scope objects, so loading the DLL doesn't construct anything new either. R0Y00's change request on `9e8d04df` is still the review decision, so the merge is blocked until R0Y00 re-reviews. AI-assisted.
R0Y00 commented 2026-12-03 10:31:15 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T10:31:15Z.


I independently tested f8646309 trial-merged on main d2e6a4ed. MSVC Debug, Windows 11 build 26300 with the D3D12 debug layer enabled: placed_build_causes and the WARP (10.0.26100.9818) and RTX 4060 Laptop (32.0.16.1656) dxr_placed_build fixtures passed 3/3, no skips.

The placement-lifetime concern raised on #3341 reproduces in the source-built fixture on both adapters. With the old source wrapper fully released, the resolver correctly returns source_not_placed. Registering a fresh slot-133 resource at the same title address, without building it, then wrongly accepts or publishes the update instead of returning source_not_built and leaving the request unchanged. The check stops before recording or submitting a GPU build. Please bind the ledger record to the live resource placement and add this release/re-register control to the original PR. The separate zero-scratch and CTest-registration follow-ups from #3341 can also stay here.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7375357564 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1943#issuecomment-7375357564). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-03T10:31:15Z. --- I independently tested f8646309 trial-merged on main d2e6a4ed. MSVC Debug, Windows 11 build 26300 with the D3D12 debug layer enabled: placed_build_causes and the WARP (10.0.26100.9818) and RTX 4060 Laptop (32.0.16.1656) dxr_placed_build fixtures passed 3/3, no skips. The placement-lifetime concern raised on #3341 reproduces in the source-built fixture on both adapters. With the old source wrapper fully released, the resolver correctly returns source_not_placed. Registering a fresh slot-133 resource at the same title address, without building it, then wrongly accepts or publishes the update instead of returning source_not_built and leaving the request unchanged. The check stops before recording or submitting a GPU build. Please bind the ledger record to the live resource placement and add this release/re-register control to the original PR. The separate zero-scratch and CTest-registration follow-ups from #3341 can also stay here.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1943:upstream-pr/1943'
git switch 'upstream-pr/1943'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/1943'
git switch 'upstream-pr/1943'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1943'
git switch 'upstream-pr/1943'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1943'
git switch 'main'
git merge --squash 'upstream-pr/1943'
git switch 'main'
git merge --ff-only 'upstream-pr/1943'
git switch 'main'
git merge 'upstream-pr/1943'
git push origin 'main'
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
R0Y00/Xbox2Windows!1936
No description provided.