startup: repair invalid D3D12 calls that flood the debug layer #3197
Open
tedin7 wants to merge 7 commits from
upstream-pr/3197 into main
pull from: upstream-pr/3197
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!3197
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3197"
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-27T21:27:58Z.
Part of #870
What this unblocks: runs with
X2W_D3D12_DEBUG=1keep the debug-layer log for real errors instead of filling it with repeated rejections of invalid calls the shim forwards.The startup device shim forwards several console requests that desktop D3D12 rejects, each with a debug-layer error (and the log budget of 400 lines ran out on them). This change repairs them before the desktop call:
ID3D12Device::CreateCommittedResource/CreatePlacedResource,D3D12_CLEAR_VALUE): dropped for buffers, for textures without render-target or depth-stencil use, for typeless formats and for a colour/depth kind mismatch; a depth clear outside [0, 1] is clamped. Applied at device slots 27/29, the committed-resource path and the title-memory texture path (optimized_clear_value.h).ID3D12Resource::Mapon a DEFAULT heap, or a CUSTOM heap withD3D12_CPU_PAGE_PROPERTY_NOT_AVAILABLE, answersE_INVALIDARGwithout the call.Unmapis forwarded only against a counted successful desktopMapof that subresource.descriptor_heap_rules.h): shader-visible CBV/SRV/UAV heaps are clamped to 1,000,000 descriptors and sampler heaps to 2048, the counts every Resource Binding tier guarantees ("Hardware Tiers"); the rest uses the existing CPU-only tail heap and title memory. RTV/DSV heaps dropSHADER_VISIBLE("Descriptor Heaps Overview"). The driver probe now starts at 1,000,000.debug_drain_budget.h): 4000 error/corruption lines plus 400 others, at most 32 lines per message id, then one "repeated N times" line at each power of two.Tests:
startup_debug_noise_check(pure): Map counting, every clear-value drop/clamp case, heap repairs, drain budget.startup_debug_noise_device_warp/_hardware(debug layer on,ID3D12InfoQueue1callback): creates a non-target texture with a clear value, a D32 target with depth 2.0, a buffer with a clear value, maps/unmaps a DEFAULT-heap texture, and creates a 1,048,577-descriptor view heap, a 4096 sampler heap and a shader-visible RTV heap through the shim. Passes only with zero debug-layer errors and no device removal; on main the invalid calls reach the runtime.Verification:
cmake -S . -B /tmp/up-debug-noise-cfg -G Ninja -DDXC_EXECUTABLE=/bin/true-> configure OKx86_64-w64-mingw32-g++ -std=c++20 -fsyntax-only -Isrc tests/startup_debug_noise_check.cpp-> OKx86_64-w64-mingw32-g++ -std=c++20 -fsyntax-only -Isrc tests/startup_debug_noise_device.cpp-> OKpython3 tests/bidi_controls_check.py-> OK;python3 tests/startup_build_rev_check.py-> OK99cc8de8(pull/3197/head), dev and release legs in parallel:x2w_pipe.py win2025 3197 --targets startup_debug_noise_check,startup_debug_noise_device,startup_view_heap_check,startup_descriptor_increment,startup_title_heap_check,startup_resource_desc,startup_clear_depth_stencil,startup_clear_uav,startup_committed_heap_state_check,startup_descriptor_heap_type_check --regex '^startup_(debug_noise_.*|view_heap_.*|descriptor_.*|title_heap.*|resource_desc_.*|clear_depth_stencil_.*|clear_uav_.*|committed_heap_state.*)$' --forcestartup_view_heap_warp/_hardwareskipped (77: this adapter accepts the oversized heap directly)/O2: 21/23 passed, same two skipsstartup_debug_noise_device_warpfails witherrors: 1as requiredDraft until an independent peer review and the Win2025 WARP gate pass.
Thanks to @Makto94 for the testing that found this.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T21:39:43Z.
Review: COMMENTED
Draft review: the new
resource_mapsentries are removed only after matching Unmaps. D3D12 permits a CPU-accessible resource to stay mapped until its final release. This shim keeps wrapper addresses registered, so a successful persistent Map followed by Release leaves a nested map entry for the rest of the run. Please retire the entry at final resource release and cover a mapped-resource lifetime in the fixture. Also consider the allocation in++resource_maps[self][subresource]under a manually held SRW lock: an allocation failure after a successful desktop Map currently escapes the wrapper and leaves the lock held.The clear-value call sites overlap #3194. When refreshing the drafts, preserve the ordering of console-to-desktop format mapping before
safe_clear, including the distinct reserved-resource slot 30 clear-argument index. The existing format-118 fixture should still preserve a valid clear value after the two changes are combined.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T23:20:24Z.
Pushed
2b71e99a5for both findings.ResourceMapCounts).E_OUTOFMEMORY, with the lock released.safe_clearand the slot 30 argument index when the draft is refreshed after #3194.Verification:
2b71e99a:x2w_pipe.py win2025 3197 --regex '^startup_debug_noise' --forcectest --preset dev3/3 passed; Release /O2 3/3 passed (startup_debug_noise_check,_device_warp,_device_hardwareon WARP).cmake -S . -B <tmp> -DDXC_EXECUTABLE=/bin/true,public_guard.py.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T23:38:49Z.
Review: COMMENTED
I independently retested the revised
2b71e99aovermainfad97f47(clean trial tree0a8a1993). The previous Map lifetime findings are addressed: final resource release retires the tracked entries, and an allocation failure after a successful desktop Map now unmaps, returnsE_OUTOFMEMORY, and releases the lock. The helper fixture covers retirement and reuse of the same address, and the device fixture releases a persistently mapped upload resource without an explicit Unmap.I built
startup_debug_noise_check startup_debug_noise_device d3d12_xs_shimand ranctest --test-dir <build> --no-tests=error -j1 -V -R '^startup_debug_noise_(check|device_(warp|hardware))$'in Debug and Release /O2: 3/3 each, no skips. WARP 10.0.26100.9818 and RTX 4060 Laptop (32.0.16.1656) on Windows 11 26200.9974 both reported zero debug-layer errors and no device removal. The separate clear-value coordination with #3194 still applies when that draft changes the shared call sites.Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-27T23:51:52Z.
Review of
2b71e99a(integrated over main):Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T10:49:18Z.
Real-GPU verification (NVIDIA RTX 3070 Ti, driver 32.0.16.2101, Windows 11):
Tested at
99cc8de. The current head is2b71e99, so commits pushed after the tested sha are not covered by this run. dev preset, ctest run one test at a time:These complement the existing WARP runs.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-28T10:49:30Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
2b71e99ℹ️ 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 chatgpt-codex-connector[bot] on 2026-11-28T10:56:45Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
2b71e99a5eℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-28T10:56:45Z.
Code review location:
src/startup_stubs/descriptor_heap_rules.h; line 15With
X2W_D3D12_RENDER=1on an adapter that accepts the full request, this unconditional clamp breaks previously supported UAV clears, even with debugging disabled. Such adapters are recorded indocs/startup-runtime.md:2714-2715. Ind3d12_xs_device.cpp,owning_view_heap()recognizes onlyheap.countphysical descriptors, andlist_clear_uav()refuses GPU handles outside that range. Consequently, a clear at descriptor index 1,000,000 or above is now dropped even when its matching CPU descriptor is in a valid staging heap. The CPU-only tail preserves descriptor writes but cannot service this GPU operation; tail descriptors need a shader-visible clear path before applying the clamp unconditionally.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-28T10:56:45Z.
Code review location:
src/startup_stubs/d3d12_xs_device.cpp; line 454With
X2W_D3D12_DEBUG=1, recording a previously unseen message ID now allocates throughDebugDrainBudget::counts_[id]. If that allocation fails,std::bad_allocescapes this call whiledebug_lockis held, bypassing its release and the normal HRESULT return from the shim. This can terminate the caller, or permanently block subsequent drains if an outer handler catches the exception. Allocation failure was reproduced against the new helper; the previous fixed-size drain required no bookkeeping allocation. Make budget recording best-effort and ensure the lock is released on failure.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-28T10:56:45Z.
Code review location:
src/startup_stubs/d3d12_xs_device.cpp; line 334If the fallback can create a heap with 65,536–124,999 descriptors but not 125,000, the new halving sequence never discovers that usable capacity: it probes 1,000,000, 500,000, 250,000 and 125,000, then exits because 62,500 is below
view_heap_probe_floor. It consequently caches a zero limit and leaves heap creation failing for subsequent requests. The parent sequence explicitly reached 65,536, so this is a regression caused by changing the ceiling away from a power of two. Probe the floor separately or clamp the last halving step to it before recording failure.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-28T10:56:46Z.
Code review location:
CMakeLists.txt; line 1776These new registrations bypass the layout documented in
AGENTS.md: “One<family>.cmakefile per test family or pull request.” The referencedtests/cmake/README.mdexplicitly requires newadd_testandset_tests_propertiescalls to go in a family fragment so independent changes do not edit the same central registration file. Move both new debug-noise registrations and their properties intotests/cmake/startup_debug_noise.cmake, which the existing glob automatically includes; the executable target definitions can remain here.AGENTS.md reference: AGENTS.md:L302-L302
Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T11:11:23Z.
Code review location:
src/startup_stubs/descriptor_heap_rules.h; line 15Valid, fixed in
2bc79c94bon up-debug-noise. The clamp to 1,000,000 now applies only below resource binding tier 3. The D3D12 resource binding spec lists tier 3 as 1000000+, so on a tier 3 device (CheckFeatureSupport OPTIONS, ResourceBindingTier) a request up to 2^20 = 1,048,576 is kept as asked, the physical heap keeps its descriptors past 1,000,000, and list_clear_uav still resolves them. If the driver refuses the size, the existing probe still shortens it. Larger requests are still clamped (to 1,048,576 on tier 3). Test: startup_debug_noise_check covers the limit parameter of safe_heap_desc (1,000,000 default, 1,048,576 for tier 3).Gate on aws-1 with WARP (x2w_pipe.py win2025 3197 --host aws-1 --regex startup_debug_noise --force, head
2bc79c94): dev and release 3/3 passed. Mutant of the floor probe (the old halving that stops before the floor), run after the main gate: startup_debug_noise_check fails.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T11:11:25Z.
Code review location:
src/startup_stubs/d3d12_xs_device.cpp; line 454Valid, fixed in
2bc79c94b. DebugDrainBudget::record is now noexcept and best effort: if the per-id counter cannot be allocated it catches std::bad_alloc and drops the line (Decision::suppress), so nothing is thrown while debug_lock is held. Test: startup_debug_noise_check replaces operator new, makes it fail while a new message id is recorded, and checks that the call returns suppress and that the id is counted normally afterwards.Gate on aws-1 with WARP (x2w_pipe.py win2025 3197 --host aws-1 --regex startup_debug_noise --force, head
2bc79c94): dev and release 3/3 passed. Mutant of the floor probe (the old halving that stops before the floor), run after the main gate: startup_debug_noise_check fails.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T11:11:27Z.
Code review location:
src/startup_stubs/d3d12_xs_device.cpp; line 334Valid, fixed in
2bc79c94b. The halving now goes through largest_halving_size() in descriptor_heap_rules.h, which clamps the last step to the floor and probes it explicitly, so a driver whose limit lies between 65,536 and 124,999 is found (1,000,000, 500,000, 250,000, 125,000, then 65,536). Test: startup_debug_noise_check checks limits of 100,000 (found as 65,536), 300,000 (250,000), a driver that refuses everything (0) and exactly 65,536.Gate on aws-1 with WARP (x2w_pipe.py win2025 3197 --host aws-1 --regex startup_debug_noise --force, head
2bc79c94): dev and release 3/3 passed. Mutant of the floor probe (the old halving that stops before the floor), run after the main gate: startup_debug_noise_check fails.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T11:11:29Z.
Code review location:
CMakeLists.txt; line 1776Valid, fixed in
2bc79c94b. The add_test calls for startup_debug_noise_check and startup_debug_noise_device_{warp,hardware}, with their set_tests_properties, moved to tests/cmake/startup_debug_noise.cmake. CMakeLists.txt keeps the executable targets and a pointer comment. cmake -S . -B -DDXC_EXECUTABLE=/bin/true configures and the three tests are registered; the gate above ran them from the fragment.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T21:58:17Z.
Merged current
maininto this branch (merge commit, no force push); head is nowa46c69db8. One conflict inresource_unmap: main added a compute-output trace call at the top, this PR the guarded unmap; both are kept, the trace first.The four review findings were already fixed in
2bc79c94b(see the thread replies).Verification (Windows Server 2025, D3D12 WARP, head
a46c69db8):x2w_pipe.py win2025 3197 --regex '^startup_(debug_noise_.*|view_heap_.*|descriptor_.*|title_heap.*|resource_desc_.*|clear_depth_stencil_.*|clear_uav_.*|committed_heap_state.*)$'-> 23/23 passed.@MasterDomino ready for review and merge when you have time.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-29T12:07:06Z.
Review: CHANGES_REQUESTED
Reviewed
a46c69dbagainstmaina30437f7. The branch no longer merges: #3194 (ae45c4ff) landed onmainafter this head was pushed and changed the same clear-value call sites. GitHub reports the PR asCONFLICTING.git merge --no-ff --no-commitofa46c69dbontoa30437f7conflicts insrc/startup_stubs/d3d12_xs_device.cppin four places; every other file merges cleanly andgit diff --checkis clean.mainaddsclear_value_format.h; this PR addspacked_target_format.h,debug_drain_budget.h,descriptor_heap_rules.handoptimized_clear_value.h.create_slot:mainnow handles slots 27, 29 and 30 withx2w_startup::desktop_clear_value(...)and a per-slot clear argument index (N == 30 ? 2 : 4); this PR handles 27 and 29 only, throughpacked_clear_value(...)andargs[4].device_place_resource(the title-memory texture path):desktop_clear_value(clear, desc->Format, texture.Format, ...)onmainagainstpacked_clear_value(clear, desktop_format(desc->Format), texture.Format, ...)followed bysafe_clearhere.create_committed: the same pair of calls.Taking this PR's side of the hunks would not build either:
packed_clear_valueno longer exists onmain(no match undersrc/ortests/);desktop_clear_valueinclear_value_format.hreplaced it and takes the title's unmapped desc format.Requested change: merge
mainand resolve these so the format mapping from #3194 runs first andsafe_clearis applied to its result, as asked in the review of99cc8de8. Concretely:desktop_clear_value(...)at all three sites and pass its result tosafe_clear(...)with the desc that is really created.create_slot, keepmain's slot 30 case and its clear index 2. Slot 30 (CreateReservedResource) takes the sameD3D12_CLEAR_VALUE, so it should go throughsafe_clearas well, or the PR should say why it is left out. A device-fixture case for a reserved resource with an invalid clear value would cover it.startup_clear_depth_stencil) has to keep a valid clear value after the two changes are combined.optimized_clear_valuetreatsD24_UNORM_S8_UINTas a depth format, so I expect it to, but I have not run it.What I did not do: because the branch cannot be built on current
main, I did not build it, run its tests, run mutants, or ask for a title run at this head. I will do those on the next head. I readoptimized_clear_value.handclear_value_format.hfor the notes above, and nothing else in the diff in depth.The four inline threads (tier 3 heap sizes, non-throwing drain budget, capacity floor probe, registrations in a fragment) were answered with
2bc79c94; I have not verified those fixes yet and they are still open on the PR.Environment: Windows 11 25H2 build 26200.9974; git trial merge only, nothing built.
CI:
Build and test on Windowspassed ona46c69db, before #3194 landed.This reply was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T13:05:05Z.
Review of head
a46c69dbagainstmain94b679e7. I read the source and ran trial merges only; I did not build or run anything.MUST
main.git merge-tree --write-tree origin/main a46c69dbexits 1 withCONFLICT (content): Merge conflict in src/startup_stubs/d3d12_xs_device.cpp, 4 hunks. These are the four hunks pigalot lists, and pigalot's review already gives the resolution (#3194'sdesktop_clear_valuefirst, thensafe_clear, slot 30 included). I have nothing to add to it.On the default launcher path
run.shandrun.ps1do not setX2W_D3D12_DEBUG:git grep -l X2W_D3D12_DEBUG origin/main -- tools/finds no file. So the drain budget only changes opt-in debug runs. TheMap/Unmapguard, the clear-value drops and the heap repairs are on with no switch.main, the first 16 loggedCreateDescriptorHeapcalls hold one shader-visible CBV/SRV/UAV heap of 1,245,184 descriptors. The rest are CPU-only heaps and one 128-entry shader-visible sampler heap. None is a shader-visible RTV/DSV heap or a sampler heap above 2048. On a tier 3 device that accepts 1,048,576, this PR's clamp gives the same size asmain's probe path. A driver that takes only 1,000,000 also ends at the same size. On this path the heap change just removes the failed first create. That matches what the body says.NIT
resource_map_lockis one exclusive lock held across every desktopMap:AcquireSRWLockExclusive(&resource_map_lock); hr = !real ? E_FAIL : cpu_hidden ? E_INVALIDARG : real->Map(subresource, range, &mapped);. That serializesMapcalls from all threads. Only the count needs the lock.Mapcould run first, then the lock could cover justrecord, with the existingUnmaponbad_alloc. A title cannotUnmapa subresource before itsMaphas returned, so nothing races.safe_clearlogsx2w-d3d12 optimized clear dropped reason=%uonce per reason, with no clear format, desc format or dimension. Printing those once per reason would show which console clear values are being dropped.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-30T13:58:56Z.
Merged current
main(077bff3ac) and addressed the map-lock and clear-value comments. Ready for CI and re-review.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T03:49:27Z.
Review: CHANGES_REQUESTED
The four clear-value conflicts are resolved at
fe1af87b. In a clean trial merge withmain41a83a9a,desktop_clear_valueruns beforesafe_clearon the creation paths, and slot 30 keeps clear argument index 2.startup_debug_noise_checkand bothstartup_clear_depth_stencilcases passed, including format 118 mapped to DXGI 45 and depth readback of 0.25/0.75 with zero debug errors on WARP and RTX 4060 Laptop.One current blocker:
startup_debug_noise_device_warppasses, butstartup_debug_noise_device_hardwarefails on the RTX 4060 Laptop. The fixture requests 1,048,577 shader-visible CBV/SRV/UAV descriptors.device_create_descriptor_heapuses the Tier 3 shortcut and sends 1,048,576 to the first desktopCreateDescriptorHeapcall. Its debug callback reportsNumDescriptors 1048576, but the limit for shader visible view heaps is 1000000. The retry succeeds at 1,000,000 and the device remains healthy, but the first error is exactly what this PR's fixture requires to avoid. A local diagnostic changing only the fixture request to 1,000,000 passed with zero errors. Please keep the oversized fixture and ensure the first call respects adapters whose effective limit is 1,000,000, while preserving the larger path where support is established.MSVC Debug:
ctest --preset dev --no-tests=error -j 1 -V -R '^(startup_debug_noise_(check|device_(warp|hardware))|startup_clear_depth_stencil_(warp|hardware))$', four passed, one failed, no skips. Windows 11 build 26300, WARP 10.0.26100.9818, RTX 4060 Laptop 32.0.16.1656, debug layer enabled for the device cases.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.