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
pull from: upstream-pr/1943
merge into: R0Y00:main
R0Y00:main
R0Y00:codex/indirect-large-backed-views
R0Y00:codex/word3-preflight-check
R0Y00:codex/vertex-table-two-records
R0Y00:codex/live-index-alias
R0Y00:codex/copied-vertex-buffer-srv
R0Y00:codex/windows-stage-test-output
R0Y00:codex/preserve-live-srv-retirement
R0Y00:codex/share-render-target-tracking
R0Y00:codex/sgd5-negative-offset-fixture
R0Y00:coverage-dashboard
R0Y00:codex/mesh-loose-root
R0Y00:codex/mesh86-cache-padding
R0Y00:codex/xmem-scatter-preflight
R0Y00:codex/mesh-depth-ps
R0Y00:codex/indirect-dispatch-refresh
R0Y00:codex/compute-container-index
R0Y00:codex/startup-compute-formatted-load
R0Y00:codex/compute-indirect-producer
R0Y00:codex/compute-atomic-soffset
R0Y00:codex/mesh-dual-handoff
R0Y00:codex/startup-run-sh-watcher-control
R0Y00:codex/queue31-page-alias
R0Y00:codex/indexed-indirect-compute-root
R0Y00:codex/typed-buffer-view-metadata
R0Y00:codex/translated-indexed-address-alias
R0Y00:codex/fixed-mesh-create-result
R0Y00:codex/xmem-section-lease
R0Y00:codex/startup-slot86-mesh-cache
R0Y00:codex/restore-mesh-barrier-iteration
R0Y00:codex/translated-indirect-upload-index
R0Y00:codex/xapu-completion-opt-in
R0Y00:codex/translated-indexed-rect
R0Y00:codex/translated-indexed-indirect
R0Y00:codex/startup-mesh-lds-integration
R0Y00:codex/startup-console-ms24
R0Y00:codex/startup-slot57-mesh-request
R0Y00:codex/indirect-copy-provenance
R0Y00:codex/present-color-producer-trace
R0Y00:codex/compute-dispatch-binding-trace
R0Y00:codex/translated-indirect-table-buffers
R0Y00:codex/indirect-copy-provenance-base
R0Y00:codex/mix-half-literal-source
R0Y00:codex/translated-indirect-draw
R0Y00:codex/xmem-scatter-diagnostics
R0Y00:codex/slot148-recording-upload
R0Y00:codex/slot70-loading-art-verified
R0Y00:codex/command-list-upload-arena
R0Y00:codex/recover-failed-command-list
R0Y00:codex/startup-heap-timing-notes
R0Y00:codex/align-audio-input-timeline
R0Y00:codex/synthetic-depth-export-control
R0Y00:codex/startup-texture1d-on-windows
R0Y00:codex/1629-packed-position-fixture
R0Y00:codex/cpu-srv-refresh
R0Y00:codex/stream-root-srv-draw
R0Y00:codex/audio-mixer-timer
R0Y00:codex/startup-reload-published-shader
R0Y00:codex/priority-integrate-1284
R0Y00:codex/guest-sixteen-page-record
R0Y00:codex/aot-placed-dxr-batch
R0Y00:codex/guest-directory-selection
R0Y00:codex/gamesave-enumerate-read
R0Y00:codex/readme-archive-to-pixels
R0Y00:codex/pe-placed-view-draw
R0Y00:codex/archive-directory-gpu
R0Y00:codex/slot133-dxr-build
R0Y00:codex/materialize-placed-vertex-view
R0Y00:codex/dstorage-directory-offsets
R0Y00:codex/xg-nine-bc-copy
R0Y00:codex/xg-slot10-bc64-arrays
R0Y00:codex/dxr-guest-address-readback
R0Y00:codex/gpu-va-high-bits
R0Y00:codex/clarify-diagnostic-startup-scope
R0Y00:codex/xg-six-levels
R0Y00:codex/typed-derived-blend
R0Y00:codex/english-legal-text-progress
R0Y00:codex/address-bc-4ks
R0Y00:codex/dstorage-bounded-file-read
R0Y00:codex/wide-srv-offsets-menu
R0Y00:codex/startup-memory-srv
R0Y00:codex/bound-view-tail
R0Y00:codex/language-selector-readback
R0Y00:codex/setup-menu-progress
R0Y00:codex/cpu-plane-refresh
R0Y00:codex/startup-ubyte-vertex
R0Y00:codex/presenter-window-selection
R0Y00:codex/startup-uniform-buffer-lane
R0Y00:codex/intro-loop-timing
R0Y00:codex/static-clzero-loops
R0Y00:codex/document-rtx-intro
R0Y00:codex/startup-insertq
R0Y00:codex/nv12-startup-texture
R0Y00:codex/stream-stage-draw
R0Y00:codex/startup-null-uav-format
R0Y00:codex/startup-draw-capture
R0Y00:codex/shorten-windows-checks
R0Y00:codex/dstorage-rfc1950
R0Y00:codex/startup-dump-fence
R0Y00:codex/pr1135-review-base
R0Y00:codex/startup-stream-requests
R0Y00:codex/startup-chroma-view
R0Y00:codex/readme-graphics-pipeline-streams
R0Y00:codex/static-crt-free-tls
R0Y00:codex/arc-140t-rtx-5080-laptop-gpu-reports
R0Y00:codex/main-startup-progress-entry
R0Y00:codex/signed-dxil-catalogue
R0Y00:codex/reloc-free-preferred-base
R0Y00:codex/quad-dpp-bit-mask
R0Y00:codex/raw-srv-bounds
R0Y00:codex/rx9070-31044-hardware-report
R0Y00:codex/gpu-page-source-provenance
R0Y00:codex/runtime-placeholder-interior
R0Y00:codex/gpu-copy-queue-tile-order
R0Y00:codex/pe-pin-external-providers
R0Y00:codex/xmem-placeholder-reservations
R0Y00:codex/xmem-shared-physical-pages
R0Y00:codex/pe-package-startup
R0Y00:codex/xmem-tools-memory-query
R0Y00:codex/cpu-stack-output-import
R0Y00:codex/pe-load-security-cookie
R0Y00:codex/record-three-bvh-retests
R0Y00:codex/cpu-rbp-frame-anchor
R0Y00:codex/xmem-default-startup
R0Y00:codex/record-rtx-3050-ti-9597
R0Y00:codex/docs-readme-start-here
R0Y00:codex/check-compute-mad24-truncation
R0Y00:codex/docs-discord-community
R0Y00:codex/bound-rcx-branch-mutants
R0Y00:codex/rtx5060ti-bvh-62114
R0Y00:codex/837-neutral-readme-disclaimer
R0Y00:codex/record-rtx-3070-ti
R0Y00:codex/title-neutral-public-wording
R0Y00:codex/exe-shadow-frame-submissions
R0Y00:codex/exe-shadow-runtime-chain
R0Y00:codex/readme-polish
R0Y00:codex/gpu-coverage-nov23
R0Y00:codex/spirv-minlod
R0Y00:codex/shadow-shim-device
R0Y00:codex/exe-two-shadow-frames
R0Y00:codex/shim-dispatch-cleanup
R0Y00:codex/fix-spirv-cache-probe
R0Y00:codex/sampler-use
R0Y00:codex/ballot-bit-extract
R0Y00:codex/packed-fma-release
R0Y00:codex/cpu-packed-fma-o2
R0Y00:codex/publish-coverage-dashboard
R0Y00:codex/mesh-cbv-binding-order
R0Y00:codex/spirv-window-fixture
R0Y00:codex/ps-e32-float-uint
R0Y00:codex/ps-cbuffer-reads
R0Y00:codex/fixed-profile-rescan
R0Y00:codex/shim-compute-integration
R0Y00:codex/readme-visible-coverage
R0Y00:codex/readme-research-navigation
R0Y00:codex/integrate-pr-256
R0Y00:codex/indexed-mesh
R0Y00:codex/sampled-coverage
R0Y00:codex/first-ms
R0Y00:codex/dual-ps
R0Y00:codex/ps-attribute
R0Y00:codex/compute-first
R0Y00:codex/ps-export
R0Y00:codex/readme-research-status
R0Y00:codex/ps-layout
R0Y00:codex/blast-window
R0Y00:codex/chart-caption
R0Y00:codex/reviewer-roles
R0Y00:codex/blast-aot
R0Y00:codex/archive-program
R0Y00:codex/crc-stream-program
R0Y00:codex/exe-image-data-chain
R0Y00:codex/local-cpu-fixture-coverage
R0Y00:codex/exe-bound-frame-chain
R0Y00:codex/exe-mapped-comparison
R0Y00:codex/contribution-dependencies
R0Y00:codex/exe-entry-aot
R0Y00:codex/bink-frame-heap-integration
R0Y00:docs/hardware-seven-reports
R0Y00:codex/bink-custom-heap
R0Y00:codex/bink-heap-callers
R0Y00:codex/discussions-entry-points
R0Y00:codex/gpu-community-batch-64
R0Y00:codex/ffx-scratch-writers
R0Y00:codex/generic-project-documentation
R0Y00:codex/ffx-dispatch-rcas
R0Y00:codex/four-windows-gpu-reports
R0Y00:codex/title-neutral-project-wording
R0Y00:codex/community-coverage-provenance
R0Y00:codex/rcas-packed-texels
R0Y00:codex/community-gpu-retests
R0Y00:codex/community-build-and-gpu-reports
R0Y00:codex/ffx-provider-loop
R0Y00:codex/ffx-recurrent-views
R0Y00:codex/ffx-recurrent-resource
R0Y00:codex/amd-wave64-reports
R0Y00:codex/ffx-backend-slots
R0Y00:codex/upscaler-device-init
R0Y00:codex/ffx-context-lifecycle
R0Y00:codex/ffx-version-query
R0Y00:codex/ffx-provider-contract
R0Y00:codex/typed-object-callback
R0Y00:codex/cpu-ordinal-import
R0Y00:codex/chained-cpu-ranges
R0Y00:codex/cpu-import-call
R0Y00:codex/cpu-direct-call
R0Y00:codex/cpu-leaf-aot
R0Y00:codex/community-project-status
R0Y00:codex/script-state-path-replay
R0Y00:codex/script-state-evidence
R0Y00:codex/bc7-resident-tail
R0Y00:codex/bcpack-mip-tail
R0Y00:codex/bc7-texture-draw
R0Y00:codex/asset-ranges
R0Y00:codex/pixel-constants
R0Y00:codex/pixel-aot
R0Y00:codex/pre-exe-workloads
R0Y00:codex/root-signature-device-coverage
R0Y00:engineering/packed-bvh-leaves
R0Y00:engineering/bvh-build-and-update
R0Y00:engineering/intake-root-roundtrip
R0Y00:community/gpu-check-release
R0Y00:community/english-contributor-entry
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1943"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 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, #1766, #1787, #1788, #1789, #1744, #1726. #1441 already conflicts withmainon its own.Verification (Windows Server 2025, D3D12 WARP, head
5a79addf, after merging currentmain)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.
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.
We couldn’t complete this review. Comment
@codex reviewto try again.5a79addℹ️ About Codex in GitHub
Your 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.
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_UPDATEcases currently stop atresolve_placed_build. Before accepting production updates, please build the source withALLOW_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 flagsImported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:11:16Z.
Part of #870, #1758. Addressed the review in
8e402dccand1c5de00a(head1c5de00a).dxr_placed_build_{hardware,warp}now builds the placed BLAS and TLAS withALLOW_UPDATE, records an in-placePERFORM_UPDATEof both throughresolve_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.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.mdnow states the caller precondition: the shim does not track provenance, so a source structure must have been built withALLOW_UPDATE.Verification (Win2025 node,
x2w_pipe.py win2025 1943 --regex '^(placed_build_causes|dxr_)'at1c5de00a):placed_build_causes,dxr_placed_build_warp,dxr_placed_build_hardwareand the otherdxr_*WARP tests pass (20/21).dxr_opacity_hardwarefails (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.
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.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T10:41:06Z.
Reopened and brought to date:
mainis merged into the branch (merge commit, no force push, head047f6f0c). One conflict, intests/dxr_placed_build.h, wheremainadded 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:--preset dev):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_)' --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)./O2(--preset release): the same build and ctest commands: 5/5 passed, same five tests.g++ -std=c++17 -Wall -Wextra tests/placed_build_causes_check.cpppasses;git diff --checkis 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 theSource: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.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T11:22:44Z.
The three gate findings are fixed (head
5a79addf,mainmerged, no force push).ALLOW_UPDATEprovenance: 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.resolve_placed_buildreports its cause through an optional out parameter, and every refusal indxr_placed_build_{warp,hardware}now requires the exact cause, not onlyE_INVALIDARG.ALLOW_UPDATE.rangeandsource_rangecannot be triggered on a real device (buffers are placed 64 KB aligned), so the translated-address rule is checked by value inplaced_build_causes, with the ledger rules; eight mutations ofplaced_build.heach fail that check.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
5a79addf711b8934ee45a77906fd4be1be98f8ad:--preset dev):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(--preset release): the same build and ctest commands: 9/9 passed, same nine tests.git diff --checkand 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.
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).ALLOW_UPDATEis refused assource_not_updatablefor an in-place update, and the same update is accepted after the TLAS is rebuilt withALLOW_UPDATE(dxr_placed_build_warp1/1).g++ -std=c++17 -O2 -Wall -Wextra -fsanitize=address,undefined tests/placed_build_causes_check.cpp: no warnings, passes;git diff --check origin/main...HEADclean.E_INVALIDARG.range/source_rangeare checked by value throughgpu_range_causeonly, because a real device places buffers 64 KB aligned (stated in the header).AI-assisted; commands listed were executed locally.
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.
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 fromdxr_placed_build_warpand_hardware) builds withALLOW_UPDATE, submits a placedPERFORM_UPDATEof 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 withoutALLOW_UPDATEis now refused assource_not_updatable. Details are in the PR body.Full merge order from our side: #1408, #1251, #1939, #1940, #1943, #2782, #2794, #2766.
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 intests/dxr_placed_build.h. WARP passes. Part of #870.Environment: Windows 11 25H2 (26200), MSVC 19.42,
devpreset, 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
Result (measured): 6/8 passed.
dxr_placed_build_warp,dxr_slot70_as_warp,dxr_update_warp,dxr_update_pipeline_warp,dxr_update_hardware,dxr_update_pipeline_hardware.dxr_placed_build_hardwareanddxr_slot70_as_hardware.dxr_placed_build_hardwarefailed on every one of 5 runs with the same message;dxr_slot70_as_hardwarefailed in the full run above (it uses the same scene).On
mainat7256cecfthe 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):
ResultDataMaxSizeInBytestsOn WARP the TLAS result size fits in the scratch buffer. On NVIDIA it does not.
Likely cause (hypothesis, from reading the code):
translate()inresolve_placed_build(d3d12_xs_device.cpp, around line 7092) callsplaced_buffer_range(address, ResultDataMaxSizeInBytes)before it looks at the buffer's state.placed_buffer_rangerejects a range that runs past the end of the buffer (d3d12_capture.inl, around line 330), so the destination is refused asnot_placedand thewrong_statetest is never reached. The scratch buffer is only768 + scratch sizebytes, 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_: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
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_statecontrol 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 withnot_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
ctestcommand on your RTX 4070 Ti after that would be very welcome.AI-assisted; commands listed were executed locally.
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 intests/dxr_placed_build.h, nosrc/change).What changed: the decoy buffers in the fixture (the scratch buffer used as a destination in the
wrong_statecontrol, 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:
devandreleasepresets:dxr_placed_build_warp,dxr_placed_build_hardware,dxr_slot70_as_warp,dxr_slot70_as_hardware: 4/4 passed in each preset.dxr_placed_build_hardwarefailed on the old head5a79addf7with the same "expected wrong_state" message you saw, and passes onb09ac9ddb: 4/4.Could you rerun the same command on your RTX 4070 Ti when you have a moment?
AI-assisted; commands listed were executed locally.
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,
devpreset (incremental build of the earlier tree, freshout/pe-env), NVIDIA GeForce RTX 4070 Ti, driver 621.35 (32.0.16.2135). Tests run serially.Command
Result (measured): 8/8 passed, ctest exit 0, in each of 3 runs. That includes
dxr_placed_build_hardwareanddxr_slot70_as_hardware, which failed on5a79addfwithexpected wrong_state.Negative control: the old head
5a79addffailed those two tests on this machine (my earlier comment), so the change intests/dxr_placed_build.his what makes them pass here.AI-Assisted
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
b09ac9ddbon 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.
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T22:16:23Z.
Review: APPROVED
Independently reviewed
b09ac9ddintegrated overmain5612e924(tree2fa7dbce). The merge is clean (CMakeLists.txt,docs/experiments.mdandsrc/startup_stubs/d3d12_xs_device.cppauto-merged) andgit diff --cached --check origin/mainis clean.Earlier findings (R0Y00, changes requested on
9e8d04df): addressed.ALLOW_UPDATE, submit an update through the placed path, read back a changed ray result.check_placed_update(called fromcheck_dxr_placed_build) does this:ALLOW_UPDATEand resolves an in-placePERFORM_UPDATEof both throughresolve_placed_build, from the title addresses of the initial build.ray results changed and equal the direct-address update and a fresh placed buildon both WARP and hardware.must_rejectcalls 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.PlacedBuildLedgerrecords theALLOW_UPDATEflag 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 indocs/experiments.md.What I traced. In
resolve_placed_buildthe update shape is checked before any lookup. The cases are:PERFORM_UPDATEwithout a source, and a source withoutPERFORM_UPDATE;The source then goes through the same placement lookup as the destination, with its causes renamed
source_*. An update's scratch is sized byUpdateScratchDataSizeInBytes. 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 defaultnullptrcause.What I ran.
devand inrelease/O2, with no skips. That isplaced_build_causes, five WARP tests and five hardware tests, withdebug_layer=enabledon the hardware runs. In both presets,dxr_placed_build_hardwareanddxr_slot70_as_hardwarelog each named refusal once, fromnot_placedthroughsource_not_updatable.releasepass failed bothcpu_placed_dxr_*tests withFileNotFoundError ... cpu_placed_dxr_lifted.exe. That was my targeted build missing that test's other targets. Both pass oncecpu_placed_dxr,cpu_placed_dxr_lifted,pe_mapandcpu_exe_ioare built.main5612e924,placed_build_causesis not registered, and the resolver returnsE_INVALIDARGfor any source orPERFORM_UPDATE.Mutants (each applied alone, the target rebuilt in
dev, file restored from its raw bytes,git diff --quietclean afterwards). Every one is killed:ALLOW_UPDATEflagplaced_build_causesledger.check_source(base + 8 * size) == Cause::source_not_updatableplaced_build_causesledger.check_source(base) == Cause::source_not_builtplaced_build_causescheck_update_shape(true, base + 256, base, size) == Cause::source_dest_partial_overlaplast_byteone past the endplaced_build_causescheck_update_shape(true, base, base + size, size) == Cause::okplaced_build_causesgpu_range_cause(gpu, 1) == Cause::rangedxr_placed_build_warpInvalid DXR update was accepted or partially published: source never builtALLOW_UPDATEdxr_placed_build_warp… source built without ALLOW_UPDATEdxr_placed_build_warpResolve update without scratch failed (HRESULT 0x80070057)dxr_placed_build_warpdxr_placed_build_warpAn in-place update must translate source and destination to the same addressNon-blocking notes.
PlacedBuildScene::resolve_updatestill says "The caller keeps ALLOW_UPDATE from the initial build; the resolver cannot see it." Since3bdbf41cthe resolver records the flag and refuses a source built without it.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 fixturesandRun platform-independent Python checks on Linuxpass onb09ac9dd.This reply was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-28T08:10:29Z.
Thanks for this. I reviewed head
b09ac9ddand 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.git merge-tree --write-tree 1f07b2c1 b09ac9ddagainst currentmainreturns rc=0 (treeb3607ea4).9e8d04df): all five are on the head. The source is built withALLOW_UPDATE. The update goes throughresolve_updateand thenBuildRaytracingAccelerationStructure.check_placed_updaterequires the result to change and to match both the direct and the fresh build. The three originalmust_rejectcontrols remain, each with its cause. The ledger givessource_not_builtandsource_not_updatable. pigalot approvedb09ac9dd, and SimSalabimse's 8/8 on an RTX 4070 Ti is at this head (the earlier head failed).g++ -std=c++17 -O2 -Wall -Wextra -fsanitize=address,undefined -Isrc tests/placed_build_causes_check.cppbuilds with 0 warnings and printsplaced build causes: all checks passed. Nine mutants ofplaced_build.hall fail. They include dropping the partial-overlap rule, ignoringallow_update, accepting an interior source address and removing theUINT64_MAXclamp inlast_byte.ctest --preset prran 40 tests, andgrep -con the Windows job log finds 0 runs ofplaced_build_causesordxr_placed_build. So far the new tests have run only locally.Suggestion (not blocking):
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 givesource_not_placed, so the test stays green. To pin the rule on a device, use sizes withResultDataMaxSizeInBytes >= 512and expect the literalCause::source_dest_partial_overlap.Nits:
2. In tests/dxr_placed_build.h, the
resolve_updatecomment still says ofALLOW_UPDATEthat "the resolver cannot see it", but the resolver now records it.3. Nothing clears the static ledger in
resolve_placed_buildwhen a placement is retired, andrecord()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 withScratchDataSizeInBytes == 0was refused before and is now accepted. The comment above it covers only updates, and no test covers a full build.5.
placed_build_causesneeds no device, but it is not in theprpreset (grep -c placed_build_causes CMakePresets.jsongives 0), so CI never runs it.6. Seven of the 11 commits have a
c1author that links to no GitHub account. A squash merge would fix that.This comment was AI-assisted.
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:
resolve_updatecomment intests/dxr_placed_build.hno longer says the resolver cannot seeALLOW_UPDATE; it records it and refuses the update without it.source_dest_partial_overlapon a device): not changed. The overlap rule is pinned by value inplaced_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.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_UPDATEprovenance) and approved by pigalot.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-29T06:25:27Z.
Review: COMMENTED
Retested
f8646309integrated overmain212d4b5f(tree570ff438). The merge is clean andgit diff --cached --check origin/mainis clean. I am not carrying my approval ofb09ac9ddover to this head yet; the reason is the real-title run below, not the code I read.What changed since
b09ac9dd.60748f14mergesmain8ecd30feinto the branch.git show --remerge-diff 60748f14is empty, so nothing was resolved by hand.f8646309rewrites one comment onPlacedBuildScene::resolve_updateintests/dxr_placed_build.h. That was the stale-comment note in my last review; it is addressed.merge-base..b09ac9ddagainst8ecd30fe..f8646309): that comment line is the only difference.mainhas not changedplaced_build.h,tests/dxr_check.cpp,tests/dxr_placed_build.hortests/cpu/placed_dxr_provider.cppsince my last review, andplaced_buffer_rangestill 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 documentALLOW_UPDATEprovenance) were addressed atb09ac9ddas 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.
devand inrelease/O2, with no skips:placed_build_causes, five WARP tests and five hardware tests. The hardware runs reportdebug_layer=enabledanddebug_errors=0 debug_warnings=0.dxr_placed_build_hardwareanddxr_slot70_as_hardwarelog each named refusal once, fromnot_placedtosource_not_updatable, anddxr_placed_build_hardwareprintsray 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 --quietclean afterwards). 10 killed, 0 surviving, 0 equivalent.ALLOW_UPDATEflagplaced_build_causesplaced_build_causes_check.cpp:122ledger.check_source(base + 8 * size) == Cause::source_not_updatableplaced_build_causes:132ledger.check_source(base) == Cause::source_not_builtplaced_build_causes:57check_update_shape(true, base + 256, base, size) == Cause::source_dest_partial_overlaplast_byteone past the endplaced_build_causes:50check_update_shape(true, base, base + size, size) == Cause::okplaced_build_causes:104gpu_range_cause(gpu, 1) == Cause::rangedxr_placed_build_warpInvalid DXR update was accepted or partially published: source never builtALLOW_UPDATEdxr_placed_build_warp... source built without ALLOW_UPDATEdxr_placed_build_warpResolve update without scratch failed (HRESULT 0x80070057)dxr_placed_build_warpdxr_placed_build_warpAn in-place update must translate source and destination to the same addressReal-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
main212d4b5f:f8646309(the PR head):[fail] frames_present: 12 of 12 checkpoint frames captured, 8 black (baseline: 0 black).f8646309merged overmain212d4b5f(the trial merge above): the same line, 8 black.8ecd30fe(themaincommit this branch last merged, without the PR):[pass] frames_present: 12 of 12 checkpoint frames captured, 0 black (baseline: 0 black).input_responsepassed, 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_buildhas no caller undersrc/(its only callers aretests/dxr_placed_build.handtests/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 (main212d4b5f, 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 atb09ac9dd; the title-run difference is open. R0Y00's changes request from9e8d04dfis 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 fixturesandRun platform-independent Python checks on Linuxpass onf8646309.This reply was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T12:48:52Z.
I re-checked
f8646309againstmain77d1ba4d. The trial merge is clean:git merge-tree --write-tree origin/main f8646309exits 0. I compared the PR's own diff at both heads (git diff <merge-base> b09ac9ddagainstgit diff 8ecd30fe f8646309). The only difference is theresolve_updatecomment, 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
placed_build_causesis device-free but still isn't in theprpreset.git show f8646309:CMakePresets.json | grep -c placed_build_causesgives0, so CI doesn't run the check that pins the overlap rule.(std::max<UINT64>)(scratch_bytes, 1)also applies to full builds. A full build whoseScratchDataSizeInBytesis 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 -- srcfinds only the definition and the declaration, so nothing in the runtime calls it. Its ledger and lock are function-local statics.placed_build.hadds no namespace-scope objects, so loading the DLL doesn't construct anything new either.R0Y00's change request on
9e8d04dfis still the review decision, so the merge is blocked until R0Y00 re-reviews.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T10:31:15Z.
I independently tested
f8646309trial-merged on maind2e6a4ed. 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.