startup: name a committed buffer behind a refused input view token #3431
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3431"
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 JB2WIN on 2026-11-29T02:11:48Z.
Part of #3224, step 1 of my claim there (issuecomment-7244582760).
"an input buffer view token's resource does not hold its range" was the top runtime refusal in a 1,049 s local start-up run on
main61ba40d1: 3 keys, 1,717,437 dispatches (counts only). It covered several cases. This splits it by what the placement index holds at the token's address. Nothing that was refused before is accepted now.… names a committed buffer__XMemAllocationHooks__, and committed buffers are never in the placement index.… buffer is placed on another device… placed buffer is not indexed at its range… resource does not hold its range(unchanged)The committed case is my guess for that top refusal:
title_resource_memorygives committed buffers title memory, but only placed buffers enter the index. A run with this split will show whether the guess holds before anything is bound.Test
startup_compute_dispatch_input_check.pygets a sixth control,dispatch-input-committed-token: a raw view token of a committed buffer. To give that buffer title memory,startup_stream_consumerexports an__XMemAllocationHooks__table. Its alloc returns memory only while that mode creates its buffer. Every other mode still gets no title memory, though the stand-in now logs its (null) hook calls.Windows 11 26200, RTX 3080 (32.0.16.2124), WARP, dev preset:
startup_compute_dispatch_input_{warp,hardware}: pass.d3d12_draw.inlchange reverted, both fail: the committed control gets the old text.startup_compute|startup_stream|startup_slot67|native_computeregression, run before the review fix below (after it, the two input checks were rerun and pass): everything passes except the four tests that also fail onmainwithout this change (startup_compute_dispatch_output_*,startup_compute_half_buffer_uav_controls/_hardware; see #3353).A read-only review flagged that a resource without a record, and one placed on another device, would have been misnamed. Both now have their own branch.
AI-assisted.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T02:49:02Z.
Review: APPROVED
Approve on
19bf3cab.All four branches inside
if (owner && owner != placed.owner)(src/startup_stubs/d3d12_draw.inl:2598-2610) returnrefuse(...), so nothing refused before is accepted. The split matches whereplacement_deviceis set: only the placed-buffer record sets it (d3d12_xs_device.cpp:5761),note_resourceleaves it null (d3d12_capture.inl:345-351),placed_buffer_rangeskips other devices (d3d12_capture.inl:386), andretire_placementerases the index entry and resetsplacementbut keepsplacement_device.The new control is not vacuous. If the exported
__XMemAllocationHooks__were not found, the committed buffer would get no guest memory, the token's address would stay 0, theif (address)block holding line 2598 would be skipped, and the exact-reason assert would fail.Not covered:
... buffer is placed on another deviceor... placed buffer is not indexed at its range, and no test asserts the unchanged... does not hold its range. These one-line mutations survive: 2605info->placement_device != device->false; 2607 condition ->false; 2603!placed.owner && info && !info->placement_device->!placed.owner.names a committed buffertests only "has a record, never placed", so it also fires for other never-placed resources with guest memory that are not on a custom heap, not only ones fed by__XMemAllocationHooks__. Records of that kind are also made by the slot 133 committed fallback (d3d12_xs_device.cpp:5834-5835) and the upload-backed memory SRV backing (d3d12_memory_srv.inl:430,444). Whether a slot 18 buffer view names those in practice is not checked. The docs sentence is narrower than the check.cmake --build --preset prandctest --preset pr(.github/workflows/windows.yml:490,493).startup_stream_consumeris not among theprbuild targets (CMakePresets.json:28-37), and theprfilter (CMakePresets.json:51) does not matchstartup_compute_dispatch_input_*.Basis: diff read in full against main
212d4b5f; nothing built or run.git merge-treewith main is clean. It is also clean with #3409 (30de88b6) and #3415 (e232e475), which touch the same function and consumer file.Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-29T02:49:41Z.
Thanks. Docs fixed in the follow-up commit: the committed-buffer reason covers every never-placed record with title memory (slot 133 committed fallback, memory SRV backing), and the control only covers the
__XMemAllocationHooks__case. Controls for the other-device and not-indexed branches need a second device or a retired placement in the consumer. I would add them in a separate change if you want them.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T03:29:14Z.
Review: APPROVED
Approve
938fa72a. The only change since19bf3cabis thedocs/experiments.mdline foran input buffer view token names a committed buffer: it now describes any record that was never placed, names the slot 133 committed fallback and the upload-backed memory SRV backing, and says the control covers the__XMemAllocationHooks__case only. That matches what the check atsrc/startup_stubs/d3d12_draw.inl:2598-2610tests. The other points in the previous review are unchanged.Controls for the other-device and not-indexed branches in a separate change are fine; they do not block this one.