Repository navigation
startup: name a committed buffer behind a refused input view token - #3431
Conversation
"an input buffer view token's resource does not hold its range" covered three cases. Split it by what the placement index found at the token's address: - no owner and the token's resource was never placed (a committed buffer: title memory from the XMem hook, never in the placement index): "an input buffer view token names a committed buffer" - no owner, but the resource was placed: "an input buffer view token's placed buffer is not indexed at its range" - another placed buffer: the old text, unchanged. Nothing that was refused is accepted now. The consumer exports __XMemAllocationHooks__ whose alloc returns memory only while dispatch-input-committed-token creates its buffer, so every other mode keeps committed resources without title memory as before. Refs R0Y00#3224. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Leyukaka
left a comment
There was a problem hiding this comment.
Approve on 19bf3ca.
All four branches inside if (owner && owner != placed.owner) (src/startup_stubs/d3d12_draw.inl:2598-2610) return refuse(...), so nothing refused before is accepted. The split matches where placement_device is set: only the placed-buffer record sets it (d3d12_xs_device.cpp:5761), note_resource leaves it null (d3d12_capture.inl:345-351), placed_buffer_range skips other devices (d3d12_capture.inl:386), and retire_placement erases the index entry and resets placement but keeps placement_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, the if (address) block holding line 2598 would be skipped, and the exact-reason assert would fail.
Not covered:
- No control reaches
... 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.- CI run 46214655915 passes on this head but does not run the new control. The pull_request job runs
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 212d4b5; nothing built or run. git merge-tree with main is clean. It is also clean with #3409 (30de88b) and #3415 (e232e47), which touch the same function and consumer file.
…th title memory Review of R0Y00#3431 (Leyukaka): the check is broader than the docs said. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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 AI-assisted. |
Leyukaka
left a comment
There was a problem hiding this comment.
Approve 938fa72a. The only change since 19bf3cab is the docs/experiments.md line for an 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 at src/startup_stubs/d3d12_draw.inl:2598-2610 tests. 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.
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
main61ba40d: 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 shader: lower direct MTBUF packed half stores #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