Repository navigation
startup: name the causes of a refused placed build and accept PERFORM_UPDATE with a source structure - #1943
startup: name the causes of a refused placed build and accept PERFORM_UPDATE with a source structure#1943tedin7 wants to merge 10 commits into
Conversation
…_UPDATE with a source structure
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
R0Y00
left a comment
There was a problem hiding this comment.
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
…LOW_UPDATE precondition Part of R0Y00#870, R0Y00#1758. Build the placed BLAS and TLAS with ALLOW_UPDATE, record the in-place update of both through resolve_placed_build, and read back four rays: the hit IDs change and equal the direct-address update and a fresh placed build.
|
Part of #870, #1758. Addressed the review in 8e402dc and 1c5de00 (head 1c5de00).
Verification (Win2025 node, AI-assisted; commands listed were executed locally. |
|
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. |
|
Reopened and brought to date: Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
The earlier review round (build the source with AI-assisted; commands listed were executed locally. |
…source lacks it; name every cause in the device tests
…tate scratch controls; drop device controls a small structure cannot reach
|
The three gate findings are fixed (head
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
Stage-2 re-gate requested. This stays a Draft until it passes. AI-assisted; commands listed were executed locally. |
|
Independent re-review of head 5a79add: 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):
AI-assisted; commands listed were executed locally. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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 placedPERFORM_UPDATEwith 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,UpdateScratchDataSizeInBytesfromGetRaytracingAccelerationStructurePrebuildInfo); Direct3D 12 documentation,D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS; and the earlier placed-build code of this repository (placed_build.h).resolve_placed_buildcollapsed six different refusals into one opaqueE_INVALIDARGand refused every update build. This names the causes and acceptsPERFORM_UPDATEwith a source structure.d3d12_memory_srv.inlandplaced_buffer_rangeare 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 ofcheck_dxr_placed_build(tests/dxr_check.cpp:581), so it runs indxr_placed_build_warpanddxr_placed_build_hardware.ALLOW_UPDATE: the fixture builds the BLAS and TLAS withALLOW_UPDATE(tests/dxr_check.cpp:231) through the placed resolver.placedScene->resolve_updatere-resolves the BLAS and the TLAS as in-placePERFORM_UPDATEbuilds (tests/dxr_check.cpp:384-386,tests/dxr_placed_build.h:246) and the translated builds are recorded after UAV barriers (:387-390).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).tests/dxr_placed_build.h), including an update whose source was built withoutALLOW_UPDATE(source_not_updatable) and one never built (source_not_built).docs/experiments.mdand now enforced by the resolver (it recordsALLOW_UPDATEper build and refuses an update without it).Changes
src/startup_stubs/placed_build.h: a standard-C++-only part withPlacedBuildCause(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_causeandPlacedBuildLedger. The Windows declarations stay below, under_WIN32.resolve_placed_buildreturns the sameE_INVALIDARGand still publishes nothing on a refusal, and now logsx2w-dxr placed build refused: <cause> (<dest|scratch|source> at title 0x...)once per cause.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 byUpdateScratchDataSizeInBytes. 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 theALLOW_UPDATEflag 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_buildreports its cause through an optional out parameter.tests/placed_build_causes_check.cpp(registered asplaced_build_causes): the device-free rules, including both aliasing outcomes and the boundaries.tests/dxr_placed_build.h(used bydxr_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.docs/experiments.md.Verified (Linux)
g++ -std=c++17 -O2 -Wall -Wextra -fsanitize=address,undefinedontests/placed_build_causes_check.cpp: no warnings, passes.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.-fsyntax-onlyond3d12_xs_device.cpp(only the MSVC-only__try/__exceptoflocal_log.h, as onmain) and ontests/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 withmain, startup: prove slot 133 placements without walking the allocation #1766, startup: pass OMSetStencilRef (slot 24) to the desktop list #1787, startup: name the command list slots the noop log can state #1788, build: write the variants of each x87 fixture in one Python process #1789, startup: clear tables on root change and log dropped root constants #1744, startup: record SetGraphicsRoot32BitConstant (slot 38) #1726. startup-d3d12: run compute pipelines that are already desktop DXIL #1441 already conflicts withmainon its own.Verification (Windows Server 2025, D3D12 WARP, head 5a79add, after merging current
main)cmake --build --preset dev --target placed_build_causes_check offscreen_check -- -j 2, thenctest --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})./O2: the same build and ctest commands with--preset release: 9/9 passed, same nine tests.g++ -std=c++17 -O2 -Wall -Wextra -fsanitize=address,undefined tests/placed_build_causes_check.cpppasses; eight mutations ofplaced_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.ALLOW_UPDATE).rangeandsource_rangecannot be triggered on a real device (buffers are placed 64 KB aligned), so the address rule is checked by value inplaced_build_causes.Not verified
PERFORM_UPDATEof the placed BLAS and TLAS (built withALLOW_UPDATE) is recorded and read back indxr_placed_build_{hardware,warp}.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.