startup: size device view descriptions by the title record #3554
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#3554
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@KelboLive on GitHub · 2026-11-30 04:28 UTC · original
Change
view_slot()sized its own checks on a slot 18-21 description from the desktop header, and forwarded thetitle's pointer to the desktop for the desktop to read at its width. The title supplies a 40-byte record;
the Agility SDK 1.620.2 header makes
D3D12_UNORDERED_ACCESS_VIEW_DESC48 bytes. A description endingexactly at a readable page therefore failed the 48-byte readability test, the 3D mip range check was
skipped, and the desktop then read its own struct from a 40-byte record and removed the device with
DXGI_ERROR_INVALID_CALL(0x887a0001).Two changes:
ViewRecord::srv_desc_bytes,ViewRecord::uav_desc_bytes, 20 fora render target, 16 for a depth-stencil view), which is what
note_view()already records for the sameslots, with
static_asserts holding each desktop struct to at least that width.never read past the title's record. The null-view adaptation reads the same copy rather than the title
pointer.
startup_view_dimension_devicegains two cases that place the description at the end of a committed pagewith a
PAGE_NOACCESSpage after it.Verification
Base
44a3ad5aa. Agility SDK 1.620.2, WARP 1.0.22, NVIDIA GeForce RTX 4070 Ti SUPER (driver 32.0.16.2101).0x887a00010x887a0001The same three rows hold on
warpand onhardware. The control row is what separates a working rangecheck from a skipped one; the middle row is the refusal the fixture expects.
Negative control: with the source change stashed and the fixture rebuilt, both boundary cases fail on
both adapters:
No regression. The change touches every view creation, so:
All five in-box failures are on
mainalready and unrelated:native_cvt_f16_i16_{ir,controls}andnative_sdwa_profiles_{ir,dxil}(issue #3549) andstartup_triage_run(#3548). Eachstartup_view_dimension_*,startup_null_views_*andstartup_present_view*entry passed.Why CI cannot see this
In-box headers already report 40 bytes, so the check succeeded before and after and the fixture passes in
both Windows jobs. The reproduction needs the Agility configuration. The three earlier instances of this
40/48 split are #3512 and #3525 (merged) and #3538 (issue); this closes the device-slot instance.
Measured detail and the case table are also recorded in
docs/experiments/agility-compute-views.md.Fixes #3538.
Follow-up at
386db6092sizeof(D3D12_RENDER_TARGET_VIEW_DESC)andsizeof(D3D12_DEPTH_STENCIL_VIEW_DESC)(24 each) instead of 20 and 16, which truncatedArraySizeat offset 16 andPlaneSliceat 20.record_view's width for those slots is the same 24, so recorded array RTV/DSV views keep their fields.static_asserts pin both to 24 bytes, so the truncation cannot return silently.844e57d.Verification at this head:
The three Agility failures (
startup_memory_srv_diag_{warp,hardware},startup_compute_comparison_srv_warp) fail identically with this change stashed, so they are not from it.Pull request details or commits were not available from GitHub; kept as an issue.
@KelboLive on GitHub · 2026-11-30 04:33 UTC · original
The Linux job's failure is inherited from
mainat44a3ad5aa, not caused by this change:That is the entry #3548 adds. #3537, #3540 and #3548 are green because their branches predate #3473; this PR is based on current
main, so it carries the failure. Nothing here touchesd3d12_compute_dispatch.inlor the triage reasons.I will rebase this branch on
mainonce #3548 lands and re-run the check, rather than duplicate the one-line fix here.@KelboLive on GitHub · 2026-11-30 06:51 UTC · original
Audited the rest of the shim for this class, so the answer to "is this the last one" is measured rather than assumed.
Compiled a probe that prints sizeof and lignof for every struct the shim sizes or forwards, once against the in-box headers and once with -I out/build/warp-agility/agility-headers/build/native/include. Of 63 structs, exactly one differs:
Everything else agrees: D3D12_SHADER_RESOURCE_VIEW_DESC, D3D12_RENDER_TARGET_VIEW_DESC, D3D12_DEPTH_STENCIL_VIEW_DESC, the blend/rasterizer/depth-stencil descriptions, D3D12_GRAPHICS_PIPELINE_STATE_DESC, D3D12_COMPUTE_PIPELINE_STATE_DESC, the indirect argument and draw/dispatch argument structs, root signature and descriptor range descriptions, D3D12_RESOURCE_DESC, heap, barrier, rect, viewport, copy-location and subresource structs.
Cross-check of every remaining use of a UAV description in the shim:
So the 40/48 split has no remaining instance. The probe is untracked scratch right now; I can add it under ools/ with the two compile lines if you would rather future SDK bumps be re-measured than re-audited by reading.
@KelboLive on GitHub · 2026-11-30 12:38 UTC · original
Both points are fixed at
386db6092, and you were right about the consequence: the truncated copy would have regressed array views that worked before.Measured layout, both header sets:
view_bytesfor slots 20 and 21 now usessizeof(D3D12_RENDER_TARGET_VIEW_DESC)andsizeof(D3D12_DEPTH_STENCIL_VIEW_DESC).record_view's width for those slots is the same 24, so recorded array RTV/DSV views keep the fields too (the SHOULD).static_asserts hold both to 24 bytes, so this cannot come back silently.Verification at this head, after rebasing onto
844e57d:The three Agility failures are
startup_memory_srv_diag_{warp,hardware}andstartup_compute_comparison_srv_warp; they fail identically with this change stashed, so they are not from it.On the suggested test: I could not get an array-DSV case to work in
startup_view_dimension_device, so I removed it rather than ship a fixture I do not understand. Creating the view removed the device even for a plainTEXTURE2DDSV on a desktop-created resource with a guest DSV heap, whilestartup_clear_depth_stencilpasses doing the same thing through the same slots. That is either a mistake in my setup that I have not found or something specific to that fixture, and I would rather report it than encode it. Thestatic_asserts are the guard in the meantime; if you can point at what I got wrong in the setup I will add the case.