Repository navigation
startup: stand in for shared-exponent render and UAV textures - #1963
Conversation
Built and ran it on this machine; the WARP skip is real and the hardware run covers the other halfWindows 11 build 26300.9974, MSVC 19.44, cmake --build --preset dev --target offscreen_check startup_packed_target_check
build exit 0
ctest --preset dev -R 'sharedexp|packed_target'
1/12 startup_packed_target ................... Passed 0.13
2/12 startup_packed_target_stand-in_control .. Passed 0.02
3/12 startup_packed_target_array_control ..... Passed 0.02
4/12 startup_packed_target_b565_control ...... Passed 0.02
5/12 startup_packed_target_sharedexp_control . Passed 0.02
6/12 startup_packed_target_sharedexp-uav_control Passed 0.02
7/12 startup_packed_target_view_control ...... Passed 0.02
8/12 startup_packed_target_tag_control ....... Passed 0.02
9/12 startup_sharedexp_target_warp ........... ***Skipped 0.25
10/12 startup_sharedexp_target_hardware ....... Passed 3.21
11/12 startup_packed_target_draw_warp ......... Passed 1.45
12/12 startup_packed_target_draw_hardware ..... Passed 5.94Skip, reported separately as AGENTS requires: That 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
Mutation
So the mapping is not just documentation; changing it fails the packed-target suite. One thing worth stating in the descriptionBecause WARP supports 67 natively, the What remains unverifiedNothing device-side beyond these two adapters: whether a title's own clear values, SRV reconstruction in translated draws, and the Notes
|
|
Thanks @ChazY11, and for running the hardware half.
Status: ready for another review. CI is green at |
tedin7
left a comment
There was a problem hiding this comment.
Review of head c2bce63d9e850d9543232227cf748b2807c73463 (comment only, not an approval).
Scope read: packed_target_format.h, the sanitized / packed_clear_value / view_slot changes in d3d12_xs_device.cpp, the SRV path in d3d12_draw.inl, CMakeLists.txt, docs and the two test files.
What I checked
- The table-driven
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.- The C++ tests are MSVC and Windows only.
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. - Mutation: I did not run my own mutation. The PR registers
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
- P1: none.
- P2: none.
- Nit 1 (
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. - Nit 2 (
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. - Nit 3 (PR body): the Verification text and the last line name AI tools. Please replace them with a neutral line, for example
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 UNKNOWN when I checked, so please rebase or re-check before Ready.
AI-assisted; commands listed were executed locally.
|
Merged current Windows 10 19045, GTX 1060 + WARP, debug layer on, full Status: ready to merge from our side. |
tedin7
left a comment
There was a problem hiding this comment.
Re-review of head f8543deee89184babc77368b67e77cbeac60525b (comment only, not an approval). Previous review was on c2bce63d.
What changed since the last review
- The only new commit is
f8543dee, "Merge main into the format-67 target branch". - I compared the added and removed lines of the PR's 9 files (
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.- Mergeable: MERGEABLE, merge state CLEAN.
- Not run: the C++ tests are MSVC and Windows only (they do not build with mingw here), and I did not queue the Windows VM. Windows CI at this head passed, which covers the new
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
- P1: none.
- P2: none.
- Nit 1 (carried over): on an adapter that supports format 67 natively,
startup_sharedexp_target_*exits 77 (skip), so CI passes without covering the substitution. Consider making that skip visible in the summary. - Nit 2 (carried over, still open): in the
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". - Nit 3 (carried over, still open): the PR body still names AI tools (the verification intro and the final AI-assisted line). Please replace them with a neutral line, for example
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.
stan495
left a comment
There was a problem hiding this comment.
Verified head f8543dee on Windows x64 (dev preset, MSVC 19.44.35228.0, SDK/DXC 10.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:- Passed (10):
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_hardware - Capability Skipped (2, exit 77):
startup_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).
- Passed (10):
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).
|
@Jess-Doit could you rebase this branch onto current GitHub reports head Files that conflict with current
Commands run locally: Once it is rebased and CI is green it will be re-checked right away. AI-assisted; commands listed were executed locally. |
Desktop D3D12 refuses R9G9B9E5_SHAREDEXP (67) as a render target or typed UAV. A single-sample 2D texture or array in that format that asks for either use is now created as R11G11B10_FLOAT (26) when the adapter lacks the use for 67 and has it for 26, through the same table-driven mapping as the 16-bit packed stand-ins. The resource is tagged with 67; RTV, UAV and SRV descriptions naming 67 on it, including SRVs rebuilt for translated draws, use 26, and an optimized clear value follows the created format. Tests: selection rows and two registered controls (format 67 left alone, a UAV-only target left alone) in startup_packed_target_check, and a WARP and hardware readback of RTV and partial UAV clears through the startup device against independently encoded R11G11B10 words. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f8543de to
5d8c1d6
Compare
|
@tedin7 thanks. Rebased onto current
Ready to merge from our side. |
…rtup/sharedexp-target-stand-in # Conflicts: # src/startup_stubs/d3d12_xs_device.cpp
|
Thanks for updating the branch, @tedin7.
Ready to merge from our side. |
tedin7
left a comment
There was a problem hiding this comment.
Review of head 6127dd7 (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.- Tests:
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. - No claim about game startup or an executable result. The docs state the limits (no bit-layout conversion on uploads and copies).
- CI on the head: Linux Python checks, gfx1013 fixtures and Windows build green.
Commands run locally on this head:
python3 tests/docs_links_check.py-> passedpython3 tests/bidi_controls_check.py-> passedgit diff --check origin/main...HEAD-> clean
Not 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.
|
Win2025 WARP receipt for head 54b0966 after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
Selection: dev 12/14 and release 12/14 passed, 2 skipped each ( AI-assisted; commands listed were executed locally. |
tedin7
left a comment
There was a problem hiding this comment.
Review of head 54b0966 (the merge of main into the branch; the PR's own change is identical to the reviewed 6127dd7).
- Code: format 67 maps to 26 only when 67 lacks a requested RT/UAV use and 26 supports all requested uses. RTV, UAV and SRV descriptions, reconstructed SRVs and optimized clear values follow the allocated format. Sampled-only resources keep their format. Limits are documented.
- Tests: new
startup_sharedexp_targetreadback plus two new--mutatecontrols (sharedexp,sharedexp-uav) next to the existing packed-target controls. Docs updated. - Win2025 (dev and release): 12/14 passed each, 2 skipped. The skipped ones are
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. - Linux:
git diff --check,tests/docs_links_check.py,tests/bidi_controls_check.pyall clean. CI green on this head. - No game or startup-blocker claim, so this is a fixture-level stand-in. I did not run the C++ mutations by hand; I relied on the registered controls above.
AI-assisted; commands listed were executed locally.
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).