startup: stand in for shared-exponent render and UAV textures #1956
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1963"
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 Jess-Doit on 2026-11-24T22:13:21Z.
Change
Add
R9G9B9E5_SHAREDEXP(67) to the packed-target mapping. When format 67lacks a requested RT or UAV use and format 26 supports every requested use,
single-sample 2D textures and arrays use
R11G11B10_FLOAT(26). The stand-incarries a format-67 tag. Explicit RTV, UAV and SRV descriptions naming 67
use format 26 on that resource, including SRVs reconstructed for translated
draws. Optimized clear values follow the allocated format.
Limits
Both formats use 32 bits per texel and clamp negative values to zero. Format
26 uses 6/6/5 mantissa bits with separate exponents. Format 67 uses three
9-bit mantissas with one shared exponent. Sampled-only resources and supported
native format-67 uses keep their format. Uploads and copies in the original
shared-exponent bit layout are not converted.
Microsoft's format specification
Verification
Tested
194fb8fc6f2520f8ca8db7f29dcc12b27b9eb42d(Codex's commit; rerun atc2bce63d, below) from18fe83d5b2ce544c20520aed49438c0618532752on Windows 10 22H2 build19045.6456 with MSVC 19.44.35230.
The fixture creates one 2D target and one two-slice array through the startup
device. Both expose format 26 with tag 67 and accept RTV, UAV and SRV
descriptions naming 67. The independent CPU references are
801e0380forthe RTV clear and
c79c0000for the partial UAV clear. The UAV input's bluechannel of
996.0encodes as992.0in format 26 and is exactlyrepresentable in format 67. The negative red channel reads zero.
devreleaseThe selection includes the packed-target unit rows, the seven registered
--mutatecontrols (two new:sharedexpleaves format 67 alone,sharedexp-uavleaves a UAV-only format-67 target alone; each must fail), the existing packedcontrols and draws, both new readbacks,
startup_stubsand the docs link check.CreateCommittedResourcereturnedE_INVALIDARG(0x80070057), D3D12 599CreateRenderTargetViewrejected the incompatible format, D3D12 38CreateUnorderedAccessViewrejected the incompatible format, D3D12 342CreateShaderResourceViewrejected the incompatible format, D3D12 28Each mutation failed CTest as expected. Restoring the source and rebuilding
passed both GPU tests again.
Set
VULKAN_SDKto the Vulkan SDK 1.4.363.0 installation and use the repository'sPython environment with
requirements-dev.txtinstalled.For the mutation controls, return the original format early from
packed_target_stand_infor format 67, or leavemappedunchanged inview_slotfor format 67 at one slot at a time (RTV 20, UAV 19, SRV 18).Rebuild and run after each change, then restore the source and repeat.
Which branch each adapter takes.
startup_sharedexp_target_*tests the substitution only on an adapter that lacks format-67 RT/UAV support, and returns 77 otherwise; it printssupport1_67,support1_26and the reason. On Windows 10 (WARP 10.0.19041.5794,support1_67=0x8013f0) and on the GTX 1060, both adapters take the substitution path. A newer WARP that supports format 67 natively (reported in review on Windows 11 build 26300) skips, so the substitution is not covered on such a runner. That skip is a branch split, not missing coverage.Clear-value control (measured after review). With
packed_clear_valuedisabled, both adapters fail at creation withE_INVALIDARGand debug-layer message 817 (D3D12_CLEAR_VALUE::Format must be equal to D3D12_RESOURCE_DESC::Format). So the draw fixture, which creates the texture with a format-67 optimized clear value, covers that mapping. Restored, both pass again.The head adds the two registered controls to Codex's commit. I reran the selection above at
c2bce63don the same machine: 14/14 in dev and in release, GTX 1060 and WARP, debug layer on, no skips.AI-assisted (Codex, driven with Claude Code; Claude Code reviewed the change, added the registered controls and reran the checks).
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T22:41:38Z.
Built and ran it on this machine; the WARP skip is real and the hardware run covers the other half
Windows 11 build 26300.9974, MSVC 19.44,
devpreset. The CTest target isoffscreen_check(notstartup_sharedexp_target—that is the test name;
--target startup_sharedexp_targetfails withunknown target):Skip, reported separately as AGENTS requires:
startup_sharedexp_target_warpreturns 77 withThat is the right skip and it says why: on this WARP build format 67 is natively usable for RT and UAV, so the substitution path it
would test does not exist there. The physical GPU takes the other branch:
tag=67withformat=26is exactly the property the description claims — the stand-in is allocated as 26 and remembers it was 67 —and both a single slice and an array are exercised.
Mutation
packed_target_format.hR9G9B9E5_SHAREDEXPinstead ofR11G11B10_FLOAT(no substitution)So the mapping is not just documentation; changing it fails the packed-target suite.
One thing worth stating in the description
Because WARP supports 67 natively, the
_warptest cannot cover the substitution on any runner where that holds, and the_hardwaretest only covers it where the GPU does not. The two together cover both branches here, but a reviewer reading "warp skipped" should
know it is a branch split, not missing coverage. Naming which branch each backend took, as the output above does, would make that
visible without running anything.
What remains unverified
Nothing device-side beyond these two adapters: whether a title's own clear values, SRV reconstruction in translated draws, and the
format-67 tag survive a full frame is not measured here, and the clear-value statement in the description rests on the controls
(
startup_packed_target_*_control), not on a draw.Notes
_hardwarecases.Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-25T00:44:14Z.
Thanks @ChazY11, and for running the hardware half.
support1_67=0x8013f0), WARP lacks format-67 RT/UAV support and takes the substitution path, like the GTX 1060. Your Windows 11 WARP supports format 67 natively and skips. The description now names which branch each adapter takes and why the skip happens.packed_clear_valuedisabled,startup_sharedexp_target_hardwareand_warpboth fail at creation withE_INVALIDARGand debug-layer message 817 (D3D12_CLEAR_VALUE::Format must be equal to D3D12_RESOURCE_DESC::Format ... R9G9B9E5_SHAREDEXP). The fixture creates the texture with a format-67 optimized clear value, so the draw covers that mapping. Restored, both pass again. This is recorded in the description; the code is unchanged.packed_viewrows, not on a draw of its own.Status: ready for another review. CI is green at
c2bce63d, and nothing else is open on our side.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:01:46Z.
Review: COMMENTED
Review of head
c2bce63d9e850d9543232227cf748b2807c73463(comment only, not an approval).Scope read:
packed_target_format.h, thesanitized/packed_clear_value/view_slotchanges ind3d12_xs_device.cpp, the SRV path ind3d12_draw.inl,CMakeLists.txt, docs and the two test files.What I checked
packed_target_mappingkeeps the 16-bit rows unchanged. Format 67 triggers on RT or UAV. The stand-in is chosen only when 67 lacks a requested use and 26 has all of them. That matches the Limits text.packed_view,mark_packed_stand_inand both view sites (view_slot,draw_translated) now use the stand-in's real format. This is consistent for RTV, UAV and the reconstructed SRV.packed_clear_valueis applied only to the committed and placed resource slots. It rewrites the clear format only when it equals the requested format and the stand-in was used. The PR's own control shows debug-layer message 817 without it.view_bytesis now the exact struct size per slot. I found no read past the descriptor. The buffer is aligned.Commands run locally
python3 tests/docs_links_check.py: self-test passed, 18 Markdown files and 386 links checked.python3 tests/bidi_controls_check.py: self-test passed, 1367 files, no bidirectional controls.git diff --check origin/main...HEAD: clean.gh pr checks 1963: Windows build and test pass, Linux Python checks pass, gfx1013 fixtures pass./O2and coverage publish were skipped.x86_64-w64-mingw32-g++fails ontests/startup_packed_target_check.cpp:95because the mingwID3D12Resource::GetDescsignature differs. I could not run them on Linux. I did not repeat the Windows run: the PR documents 14/14 on GTX 1060 and WARP at this head, and the Windows CI job passed.sharedexp,sharedexp-uavand the existingview/tagcontrols as WILL_FAIL ctest entries, and the body records the manual RTV, UAV and SRV slot mutations and the clear-value mutation. Those mutations are not part of the CI job.Findings
startup_sharedexp_target.cpp): on an adapter that supports 67 natively, such as newer WARP on Windows 11, the draw fixture returns 77 (skip). CI would then pass without covering the substitution. The body says so. Consider making the skip visible in the CI summary.packed_target_format.hheader comment): it says "R11G11B10_FLOAT has 6/6/5 mantissa bits". Say "6/6/5 mantissa bits plus per-channel 5-bit exponents" so the exponent difference is clear in one place.AI-assisted; commands listed were executed locally., to follow the repo rule on titles and bodies.Clean-room / title: the title is neutral. The only reference is the public Microsoft format spec. mergeable was
UNKNOWNwhen I checked, so please rebase or re-check before Ready.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T05:25:41Z.
Review: COMMENTED
Re-review of head
f8543deee89184babc77368b67e77cbeac60525b(comment only, not an approval). Previous review was onc2bce63d.What changed since the last review
f8543dee, "Merge main into the format-67 target branch".CMakeLists.txt, two docs,d3d12_draw.inl,d3d12_xs_device.cpp,packed_target_format.h,offscreen_check.cpp,startup_packed_target_check.cpp,startup_sharedexp_target.cpp) betweenc2bce63^..c2bce63andorigin/main...HEAD. Both sets are identical (383 lines each, empty diff). The merge introduced no change to the PR's own code, so my earlier code findings still hold.Commands run locally (at this head)
git diff --stat origin/main...HEAD: 9 files, +372 -39.python3 tests/docs_links_check.py: self-test passed, 18 Markdown files and 407 links checked.python3 tests/bidi_controls_check.py: self-test passed, 1488 files, no bidirectional controls.git diff --check origin/main...HEAD: clean.gh pr checks 1963: Windows build and test pass, Linux Python checks pass, gfx1013 fixtures pass./O2and coverage publish were skipped.startup_packed_target_*_controlandstartup_sharedexp_target_*ctest entries. I did not run my own mutation: the PR ships WILL_FAIL controls (sharedexp,sharedexp-uav,view,tag) that serve as mutations in CI.Findings
startup_sharedexp_target_*exits 77 (skip), so CI passes without covering the substitution. Consider making that skip visible in the summary.packed_target_format.hheader comment, "R11G11B10_FLOAT has 6/6/5 mantissa bits" should say "6/6/5 mantissa bits plus per-channel 5-bit exponents".AI-assisted; commands listed were executed locally..The title is neutral and the change is clean-room (public format spec only); the body needs the Nit 3 wording fix. No blocking issues.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-25T05:48:25Z.
Review: APPROVED
Verified head
f8543deeon Windows x64 (devpreset, MSVC19.44.35228.0, SDK/DXC10.0.26100.0):cmake --build --preset dev --target offscreen_check startup_packed_target_check startup_stream_consumer d3d12_xs_shim-> succeededctest --preset dev --no-tests=error -R '^(startup_packed_target|startup_sharedexp_target_)' -V:startup_packed_target(97 rows), all 7 mutation controls (stand-in,array,b565,sharedexp,sharedexp-uav,view,tag),startup_packed_target_draw_warp,startup_packed_target_draw_hardwarestartup_sharedexp_target_warp(Microsoft Basic Render Driver,10.0.26100.9818) andstartup_sharedexp_target_hardware(AMD Radeon RX 7900 XTX,32.0.32029.2010) both skipped becauseadapter supports native format-67 RT and UAV views(support1_67=0x2e8d3f0on RX 7900 XTX).Verdict: Approved at
f8543dee(noting the format-67 capability skips above; fallback draw still needs an adapter without native format-67 RT/UAV support if desired).Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-25T05:21:14Z.
Merged current
main(ab9a020c) atf8543dee. The only conflict wastests/offscreen_check.cpp, where main addedrun_startup_image_load_d16at the same spot asrun_startup_sharedexp_target. Both are kept, and both dispatch entries are present.Windows 10 19045, GTX 1060 + WARP, debug layer on, full
devbuild: all 12 of this PR's packed-target and shared-exponent cases pass (startup_packed_target*including thesharedexp/sharedexp-uavcontrols,startup_sharedexp_target_{warp,hardware}andstartup_packed_target_draw_{warp,hardware}). Main's newstartup_image_load_d16_hardwareand_controlspass too.startup_image_load_d16_warpfails here withCompute completion failed (HRESULT 0x887a0005)on the in-box Windows 10 WARP (10.0.19041). It fails the same way on amain-based build, so it is a host issue in that test, not part of this merge.Status: ready to merge from our side.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T13:29:44Z.
@Jess-Doit could you rebase this branch onto current
mainand force-push?GitHub reports head
f8543deeas conflicting withmain, so it cannot be merged as is.Files that conflict with current
main(39a576c0):tests/offscreen_check.cppCommands run locally:
Once it is rebased and CI is green it will be re-checked right away.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-25T17:09:17Z.
@tedin7 thanks. Rebased onto current
main(7092683a) as one commit and force-pushed: head is now5d8c1d68.tests/offscreen_check.cppanddocs/experiments.md. Both sides had added an entry at the same spot, so both are kept, andrun_startup_sharedexp_targetkeeps its own return.sharedexp|startup_packed_target|startup_image_load_d16on Windows 10 build 19045,devpreset, GTX 1060 6GB (driver 32.0.15.6094) and in-box WARP 10.0.19041.startup_image_load_d16_warp. It fails the same way onmainon this host's Windows 10 WARP. The hardware variant passes.Ready to merge from our side.
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-25T18:34:35Z.
Thanks for updating the branch, @tedin7.
mainmoved again right after (dbab5435, including #2443), so I merged it on top of your merge rather than rebasing: head is now6127dd7d.src/startup_stubs/d3d12_xs_device.cpp:packed_clear_valuefrom this PR, and #2443'srelease_retired_enabledandretire_class, added at the same spot. Both are kept.devpreset, GTX 1060 6GB (driver 32.0.15.6094) and in-box WARP.startup_(packed_target|sharedexp_target|resource_budget|image_load_d16): 22 of 23 pass. The one failure isstartup_image_load_d16_warp, which also fails onmainon this host's WARP.startup_resource_retire_: 6 of 6, with the switch on and off, on both adapters.Ready to merge from our side.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:24:45Z.
Review: COMMENTED
Review of head
6127dd7d(comment only).Result: no problem found in the code. Not merged by us because the branch is 30 commits behind main (limit 20) and there is no Win2025 run on this head.
Checked:
packed_target_format.h: the singlepacked_target_mappingstable now drivespacked_target_format,packed_target_stand_in,mark_packed_stand_inandpacked_view. The 16-bit to R8G8B8A8 entries keep their old behaviour (RTV trigger, same support check). Format 67 triggers on RTV or UAV, requires every requested use on format 26, and keeps its own format when the adapter supports it.d3d12_draw.inl: the stand-in SRV now takes the real texture format instead of a hardcoded R8G8B8A8, which is needed for format 26. The log line now prints the actual format.startup_sharedexp_target.cppcovers 2D and array, RTV/UAV/SRV, with CPU reference words, and both adapter branches (substitution and native) as described by the author. The old packed-format test was extended, not duplicated.Commands run locally on this head:
python3 tests/docs_links_check.py-> passedpython3 tests/bidi_controls_check.py-> passedgit diff --check origin/main...HEAD-> cleanNot verified here: the C++ fixtures (
startup_sharedexp_target_*,startup_packed_target*) need D3D12 and only run on Windows, so I ran no mutation on them. The author's Windows 10 results (GTX 1060 and WARP) are on an earlier commit than this merge head.Next step: update the branch with main (30 behind), then a Win2025 dev+release run on the new head, then it can be merged.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:31:57Z.
Review: COMMENTED
Review of head
54b09665(the merge of main into the branch; the PR's own change is identical to the reviewed6127dd7d).startup_sharedexp_targetreadback plus two new--mutatecontrols (sharedexp,sharedexp-uav) next to the existing packed-target controls. Docs updated.startup_sharedexp_target_warpand_hardware: they return 77 because Server 2025 WARP supports format 67 natively, so the substitution readback branch did not run here. The other half was run on a GTX 1060 and on WARP 10.0.19041 by the author and by ChazY11. All packed-target and sharedexp mutation controls passed.git diff --check,tests/docs_links_check.py,tests/bidi_controls_check.pyall clean. CI green on this head.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:31:48Z.
Win2025 WARP receipt for head
54b09665after updating with main.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
54b09665c59090e6ee59ac6a79d54b7c63bf3360:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim offscreen_check startup_packed_target_check startup_stream_consumer -- -j 2):61.22s(configure0.00s)ctest --preset dev -R '^(startup_(packed_target.*|sharedexp_target.*|stubs)|docs_links)$' --parallel 2 --no-tests=error --output-on-failure): 12/14 passed (17.44s:startup_stubs5.39s,startup_packed_target0.52s,startup_packed_target_stand-in_control0.29s,startup_packed_target_array_control0.34s,startup_packed_target_draw_warp6.84s,startup_packed_target_b565_control0.48s,startup_packed_target_sharedexp_control0.28s,startup_packed_target_sharedexp-uav_control0.26s,startup_packed_target_view_control0.47s,startup_packed_target_tag_control0.49s,startup_sharedexp_target_hardware0.44s,startup_sharedexp_target_warp0.70s,docs_links6.66s,startup_packed_target_draw_hardware7.68s); skipped (capability, not a pass):startup_sharedexp_target_hardware,startup_sharedexp_target_warp/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim offscreen_check startup_packed_target_check startup_stream_consumer -- -j 2):17.46s(configure0.00s)ctest --preset release -R '^(startup_(packed_target.*|sharedexp_target.*|stubs)|docs_links)$' --parallel 2 --no-tests=error --output-on-failure): 12/14 passed (21.28s:startup_stubs9.59s,startup_packed_target_draw_warp9.62s,startup_packed_target_stand-in_control0.11s,startup_packed_target0.49s,startup_packed_target_array_control0.37s,startup_packed_target_sharedexp_control0.22s,startup_packed_target_b565_control0.55s,startup_packed_target_sharedexp-uav_control0.46s,startup_packed_target_view_control0.49s,startup_packed_target_tag_control0.53s,startup_sharedexp_target_hardware0.37s,startup_sharedexp_target_warp0.72s,docs_links3.60s,startup_packed_target_draw_hardware6.33s); skipped (capability, not a pass):startup_sharedexp_target_hardware,startup_sharedexp_target_warpsccache: 6/58 hits; wall113.2sSelection: dev 12/14 and release 12/14 passed, 2 skipped each (
startup_sharedexp_target_warpand_hardwarereturn 77: Server 2025 WARP exposes native format-67 RT/UAV, so the new readback branch does not run here; the seven--mutatecontrols, including the two new sharedexp ones, did run and pass).AI-assisted; commands listed were executed locally.