Skip to content

shader: support BUF_FMT_2_10_10_10_UNORM fetch format in gfx2hlsl (Part of #1723) - #2006

Merged
MasterDomino merged 10 commits into
R0Y00:mainfrom
tedin7:x2w-pipe-buf-2101010-unorm
Nov 26, 2026
Merged

MasterDomino merged 10 commits into
R0Y00:mainfrom
tedin7:x2w-pipe-buf-2101010-unorm

Conversation

@tedin7

@tedin7 tedin7 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #1723

What this unblocks: vertex shaders whose input layout uses packed 10-10-10-2 UNORM (DXGI_FORMAT_R10G10B10A2_UNORM) no longer get refused with buffer format BUF_FMT_2_10_10_10_UNORM.

Changes:

  • tools/startup/gfx2hlsl.py: FETCH_FORMATS gains BUF_FMT_2_10_10_10_UNORM (x, y, z = 10-bit fields / 1023, w = 2-bit field / 3, one dword read with ldu). FETCH_DXGI maps DXGI 24 to it.
  • tests/startup_gfx2hlsl_tbuffer_2101010_check.py (new, registered in CMake): constructed MTBUF bytes, decoded, translated, emitted expressions evaluated against a reference from the format definition. Also checks the SNORM sibling stays refused.

Verification:

  • Shader cache revision moved to x2w-startup-shader-20 / 20cs (the run-time FORMAT switch gains case 50); known-answer keys updated in startup_shader_cache_key_check.py and startup_compute_request_offline_check.py.
  • tests/startup_buffer_format_word3_check.cpp now lists DXGI_FORMAT_R10G10B10A2_UNORM in decoded[] and checks view_word3 gives 50u << 12 | identity.
  • Docs: docs/experiments.md and docs/startup-runtime.md describe the WARP/hardware draw readback and revision 20.
  • Win2025 (Windows Server 2025 build 26100, MSVC 14.44.35207, D3D12 WARP) at a2e70c73d2b16e42a1bb0adbb016a37507f916da, ctest --preset dev|release -R '^(startup_gfx2hlsl_tbuffer_2101010|startup_buffer_format_word3|startup_vertex_fetch_formats_controls|startup_vertex_fetch_formats_warp|startup_shader_cache_key|startup_compute_request_offline)' --no-tests=error: dev 8/8 and release 8/8 passed. Tests: startup_gfx2hlsl_tbuffer_2101010, startup_buffer_format_word3, startup_buffer_format_word3_mapping_control, startup_buffer_format_word3_table, startup_shader_cache_key, startup_compute_request_offline, startup_vertex_fetch_formats_controls, startup_vertex_fetch_formats_warp.
  • Linux: python3 -B tests/startup_gfx2hlsl_tbuffer_2101010_check.py PASS; the same test against the unmodified gfx2hlsl.py from origin/main fails with Unsupported: buffer format BUF_FMT_2_10_10_10_UNORM.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T23:04:17.962325Z e05cff2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e05cff2676

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/startup/gfx2hlsl.py Resolved
Comment thread CMakeLists.txt Resolved
@ChazY11

ChazY11 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Ran it, broke it four ways — all caught — and checked the unpacking against the DXGI definition

Windows 11 build 26300.9974, device-free:

out/pe-env/Scripts/python.exe -B tests/startup_gfx2hlsl_tbuffer_2101010_check.py
DXGI 24 maps to the format: ok
the SNORM sibling stays refused: ok
PASS      exit 0
mutation in FETCH_FORMATS result
((w >> 10) & 1023) → (w >> 10) (y picks up z's bits) caught
/ 1023.0 → / 1024.0 on x caught
(w >> 30) / 3.0 → / 4.0 on w caught
x taken from bits 20 instead of 0 (x and z swapped) caught

So the field order, the per-field mask and the divisor are each pinned, not only the text.

The arithmetic, checked against DXGI_FORMAT_R10G10B10A2_UNORM

I transcribed the four emitted expressions and compared them with the format definition over the boundary values of every 10-bit channel and all
four values of the 2-bit one:

words checked: 512  mismatches: 0  worst delta: 0

x endpoints: field 0 -> 0.000000, field 1023 -> 1.000000
w levels:    0.000000, 0.333333, 0.666667, 1.000000

The endpoint being exactly 1.0 matters for a vertex attribute: x / 1023.0 reaches 1.0 only because the divisor is 1023 and not 1024, which is
also why the second mutation above is the one that would corrupt a fully-saturated channel silently.

On the merge with what is already on main

Your branch is 15 commits behind (merge-base 36a9a06f), so a plain diff against main shows #1992's six VEC_U entries as deletions — they are
not yours to delete. I checked the actual merge rather than the diff:

git checkout -B merge-2006 origin/main && git merge review-2006
# no conflicts
out/pe-env/Scripts/python.exe -B tests/startup_gfx2hlsl_tbuffer_2101010_check.py   # exit 0
out/pe-env/Scripts/python.exe -B tests/startup_gfx2hlsl_int_med3_check.py          # exit 0
# v_min3_i32 is still present after the merge

Both suites are green together, so no rebase is required for this to land — just be aware that a diff-based reviewer may misread those deletions.

What is not covered

The SNORM sibling staying refused is asserted; the rest of the 10-10-10 family (BUF_FMT_2_10_10_10_SNORM, the _A2 spellings) is not, and this
patch does not claim otherwise. No vertex shader was compiled or run, which matches the description's framing (it unblocks the refusal, it does not
measure a draw).

Notes

  • AI-assisted review.

@ChazY11

ChazY11 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Merge matrix for the 16 open PRs that touch tools/startup/gfx2hlsl.py

I computed each PR's changed line ranges against its own merge base (not against main, which makes stale branches look like they delete other
people's work), then looked for pairs whose ranges overlap.

PR      hunks  lines  behind  ranges
#2020      3     54       7  (1444,1486) (1528,1530) (1907,1914)
#2014      5     15       7  (677,679) (682,683) (686,692) (704,705) (1719,1719)
#2012      1     18     121  (1272,1289)
#2010      2      7      22  (1649,1649) (1846,1851)
#2008      6     48      22  (8,8) (13,13) (2009,2015) (2037,2038) (2041,2071) (2337,2342)
#2007      1     43      27  (923,965)
#2006      2      4      22  (78,79) (87,88)
#2005      1      3      22  (87,89)
#2004      1      1      22  (85,85)
#2003      1     33      22  (923,955)
#2002      3     12      48  (104,105) (157,162) (1079,1082)
#1997      3     23      38  (1146,1158) (1162,1170) (1993,1993)
#1995      1     20      40  (1304,1323)
#1984      1      5      69  (293,297)
#1952      2      6     119  (1597,1597) (1792,1796)
#1946      1     11     121  (424,434)

Only 2 of 120 pairs overlap:

pair overlap what it is
#2007 vs #2003 923–955 both add op_s_bfm_b64
#2006 vs #2005 87–88 both extend FETCH_FORMATS (10-10-10-2 UNORM vs 16-16 SNORM)

But line overlap is only half the story

I merged the overlapping pairs, and then a pair that does not overlap:

#2006 + #2005   conflict: CMakeLists.txt
#2003 + #2007   conflict: AGENTS.md, tests/startup_gfx2hlsl_bfm_b64_check.py (AA), tools/startup/gfx2hlsl.py
#2012 + #1995   order-dependent:
                  merge 2012 then 1995 -> conflict only in CMakeLists.txt, gfx2hlsl.py merges to ONE op_v_swap_b32
                  merge 1995 then 2012 -> conflicts in CMakeLists.txt, tests/..._swap_check.py (AA), gfx2hlsl.py
                                          and then BOTH implementations are present in that file

#2012 and #1995 add the same method at lines 1272 and 1304 — far apart, so nothing overlaps, yet they are the same feature. In one merge order
git silently keeps a single definition (one author's behaviour is lost with no marker); in the other it keeps both. Neither outcome is a rebase of
the other, and the reviewer would have to notice by reading the file.

So: line-overlap predicts textual conflicts, not duplicate additions. For a file where 16 people are each adding one handler, the dangerous
case is the one this matrix does not flag, and the two duplicate pairs above (#1995/#2012 on v_swap_b32, #2003/#2007 on s_bfm_b64) are
exactly that.

What I would do with this

  1. Land one of each duplicate pair first, and tell the other author to rebase onto it (I have already reviewed startup: lower s_bfm_b64 in gfx2hlsl #2007 at behaviour level and startup: lower v_swap_b32 in gfx2hlsl #1995
    the same way, so both are safe choices).
  2. For #2006 / #2005, whichever goes second needs a one-line rebase of two adjacent dict entries — trivial, but it will be a conflict rather
    than a merge.
  3. Everything else in the table is disjoint: any order among the remaining 12 lands without touching another PR's lines.

The script is 40 lines (merge-base, git diff -U0, range intersection) if you want it as a CI job — but a cheaper version is just "search the
open PR titles for the mnemonic", which would have caught both duplicates before either branch existed.

Applied to this PR

This PR is one half of the #2006 + #2005 overlap: both extend FETCH_FORMATS at lines 87–88, so whichever lands second needs a one-line
rebase of two adjacent dict entries. Nothing else here affects you.

Notes

  • AI-assisted analysis, computed on main 7f149ac9.

@RavenCurseBurg

Copy link
Copy Markdown
Contributor

I ran an independent device readback against the translator at 2a920695. The test-only commit applies directly to this head and extends the existing format suite.

On WARP and a physical D3D12 adapter, I compiled the generated VS with DXC and invoked the same vertex body from the compute readback wrapper. Sixteen packed vertices at stride 5, offset 3 cover all four byte alignments and all four alpha levels. On each adapter all 64 decoded components and 256 surrounding sentinel words matched. Reading blue from green, dividing alpha by four and replacing the unaligned load with an aligned load each produced a readback mismatch. The existing device-free test also passed.

Reproduce with python -B tests/startup_vertex_fetch_formats_check.py <dxc> <offscreen_check> warp and again with hardware. Both full runs passed all 13 formats and detected all 12 shader mutations. The local debug layer was unavailable.

@tedin7
tedin7 force-pushed the x2w-pipe-buf-2101010-unorm branch from b8daf94 to 328b603 Compare November 25, 2026 10:58
@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Thank you @ChazY11 for the four-mutation run and the DXGI cross-check of the unpacking, and @RavenCurseBurg for the independent WARP + hardware readback at 2a920695 (13 formats passed, 12 shader mutations detected). Recorded as extra evidence for this PR.

AI-assisted; commands listed were executed locally.

@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @ChazY11 for the merge matrix, and @RavenCurseBurg for the readback.

I merged origin/main into this branch (plain merge, no rebase). It was clean, with no conflicts. The new head is 9fcd600a. The old head was 328b603d.

The diff against main is now only our 4 files (+134/-1): tools/startup/gfx2hlsl.py, the new tbuffer test, CMakeLists.txt and docs/experiments.md. The earlier phantom deletions of the VEC_U entries are gone.

On the #2005 overlap: whichever of #2006 and #2005 lands second needs a small rebase of the adjacent FETCH_FORMATS entries. I will do that for this PR if #2005 lands first.

Commands run locally on Linux:

  • git merge origin/main
  • python3 -I -B tests/startup_gfx2hlsl_tbuffer_2101010_check.py (PASS)
  • python3 -I -B tests/startup_gfx2hlsl_int_med3_check.py (PASS)
  • python3 -I -B -m py_compile tools/startup/gfx2hlsl.py

The Windows WARP run is still pending on the new head.

AI-assisted; commands listed were executed locally.

@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is.

We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here.

AI-assisted; commands listed were executed locally.

@tedin7 tedin7 closed this Nov 25, 2026
@tedin7 tedin7 reopened this Nov 26, 2026
… the descriptor switch (R0Y00#1723)

Merge origin/main, add format 50 to DESC_FORMAT_CODES, the runtime supported-format list and the
R10G10B10A2_UNORM word-3 mapping, and extend startup_vertex_fetch_formats with a packed-field reference,
wrong references and mutations.
@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit c23207494ca2ca604bf2df4d11cae90efcfbe9bf:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2): 160.87s (configure 4.49s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2): 205.87s (configure 3.62s)
  • Windows Python checks: tests/mesh_heap_sampler_check.py ok (1.0s), tests/startup_buffer_address_check.py ok (0.5s), tests/startup_buffer_format_word3_table_check.py ok (0.1s), tests/startup_compute_request_offline_check.py ok (0.5s), tests/startup_compute_store_format_xyzw_check.py ok (0.3s), tests/startup_compute_translate_check.py ok (0.2s), tests/startup_flat_param_check.py ok (0.2s), tests/startup_gfx2hlsl_add_sub_co_check.py ok (0.1s), tests/startup_gfx2hlsl_add_sub_co_ci_check.py ok (0.2s), tests/startup_gfx2hlsl_bit_alu_check.py ok (0.8s), tests/startup_gfx2hlsl_capture_check.py ok (1.2s), tests/startup_gfx2hlsl_cmp16_check.py ok (0.4s), tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.py ok (39.9s), tests/startup_gfx2hlsl_compare_dst_check.py ok (0.1s), tests/startup_gfx2hlsl_compute_check.py ok (0.5s), tests/startup_gfx2hlsl_cselect_mask_check.py ok (0.1s), tests/startup_gfx2hlsl_cvt_alu_check.py ok (0.3s), tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py ok (0.3s), tests/startup_gfx2hlsl_cvt_pk_int16_check.py ok (0.3s), tests/startup_gfx2hlsl_f32_lg_check.py ok (1.3s), tests/startup_gfx2hlsl_f32_nan_check.py ok (5.3s), tests/startup_gfx2hlsl_fma_mix_check.py ok (0.1s), tests/startup_gfx2hlsl_getpc_refusal_check.py ok (0.1s), tests/startup_gfx2hlsl_handler_arity_check.py ok (0.1s), tests/startup_gfx2hlsl_heap_record_check.py ok (0.2s), tests/startup_gfx2hlsl_image_arity_check.py ok (0.1s), tests/startup_gfx2hlsl_image_get_lod_check.py ok (0.2s), tests/startup_gfx2hlsl_int_med3_check.py ok (0.1s), tests/startup_gfx2hlsl_interp_p2_hi_check.py ok (0.3s), tests/startup_gfx2hlsl_join_symbols_check.py ok (0.3s), tests/startup_gfx2hlsl_loop_constants_check.py ok (0.1s), tests/startup_gfx2hlsl_mask_data_check.py ok (0.1s), tests/startup_gfx2hlsl_mask_overwrite_check.py ok (0.1s), tests/startup_gfx2hlsl_operand_count_check.py ok (0.4s), tests/startup_gfx2hlsl_pack_absdiff_check.py ok (3.1s), tests/startup_gfx2hlsl_pack_b32_f16_check.py ok (0.2s), tests/startup_gfx2hlsl_readfirstlane_recompute_check.py ok (0.1s), tests/startup_gfx2hlsl_readfirstlane_uniform_check.py ok (0.2s), tests/startup_gfx2hlsl_refusals_check.py ok (0.8s), tests/startup_gfx2hlsl_root_check.py ok (1.0s), tests/startup_gfx2hlsl_s_abs_check.py ok (0.1s), tests/startup_gfx2hlsl_s_bitset_check.py ok (0.2s), tests/startup_gfx2hlsl_s_ff0_check.py ok (0.1s), tests/startup_gfx2hlsl_s_ff1_check.py ok (0.1s), tests/startup_gfx2hlsl_s_flbit_check.py ok (0.1s), tests/startup_gfx2hlsl_s_quadmask_check.py ok (0.2s), tests/startup_gfx2hlsl_sad_check.py ok (0.6s), tests/startup_gfx2hlsl_saveexec_same_reg_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_arity_check.py ok (0.3s), tests/startup_gfx2hlsl_scalar_brev_fold_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_m0_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_null_check.py ok (0.4s), tests/startup_gfx2hlsl_scalar_table_arity_check.py ok (0.6s), tests/startup_gfx2hlsl_sdwa_cndmask_check.py ok (0.3s), tests/startup_gfx2hlsl_sdwa_cvt_check.py ok (0.4s), tests/startup_gfx2hlsl_sgpr_spill_check.py ok (0.2s), tests/startup_gfx2hlsl_shift64_check.py ok (0.3s), tests/startup_gfx2hlsl_sload_const_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_smem_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_sop2_complement_check.py ok (8.1s), tests/startup_gfx2hlsl_sopk_accum_check.py ok (1.7s), tests/startup_gfx2hlsl_sopk_signext_check.py ok (0.2s), tests/startup_gfx2hlsl_spill_branches_check.py ok (1.7s), tests/startup_gfx2hlsl_swap_check.py ok (0.6s), tests/startup_gfx2hlsl_vopc_sdwa_check.py ok (8.8s), tests/startup_gfx2hlsl_waitcnt_depctr_check.py ok (0.2s), tests/startup_gfx2hlsl_watch_check.py ok (3.1s), tests/startup_image_2d_array_check.py ok (0.3s), tests/startup_image_3d_check.py ok (0.3s), tests/startup_image_gather_lz_check.py ok (1.0s), tests/startup_image_load_d16_check.py ok (1.6s), tests/startup_image_sample_a16_check.py ok (0.3s), tests/startup_image_sample_b_check.py ok (0.3s), tests/startup_image_sample_c_check.py ok (0.4s), tests/startup_image_sample_l_check.py ok (0.3s), tests/startup_image_sample_lod_check.py ok (1.1s), tests/startup_inline_sampler_check.py ok (0.3s), tests/startup_mesh57_depth_only_check.py ok (0.3s), tests/startup_mesh57_lane_spill_check.py ok (0.4s), tests/startup_mesh57_loop_check.py ok (0.3s), tests/startup_mesh57_loop_refusal_check.py ok (0.3s), tests/startup_mesh57_skeleton_check.py ok (2.1s), tests/startup_run_ps1_check.py ok (34.8s), tests/startup_run_sh_check.py skipped (0.7s), tests/startup_sampler_heap_check.py ok (0.3s), tests/startup_shader_cache_rekey_check.py ok (7.4s), tests/startup_smem_address_check.py ok (0.3s), tests/startup_stream_fetch_check.py ok (0.4s), tests/startup_stream_interface_check.py ok (0.4s), tests/startup_translator_check.py ok (0.7s)
  • sccache: 34/77 hits; wall 526.5s

@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

@MasterDomino: #2006 is ready for review/merge.

What changed: merged current main into the branch (one docs conflict in docs/experiments.md, kept both sections). New head c2320749.

Verification:

  • python3 tests/startup_gfx2hlsl_tbuffer_2101010_check.py PASS
  • python3 tests/startup_buffer_format_word3_table_check.py ok
  • Win2025 WARP dev + release PASS on c23207494ca2ca604bf2df4d11cae90efcfbe9bf (receipt in the comment above), including the D3D12 WARP readback fetch test

AI-assisted; commands listed were executed locally.

@MasterDomino MasterDomino left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed c2320749.

The decode is right:

  • x, y and z come from bits 9:0, 19:10 and 29:20, and w is bits 31:30 / 3. That's the R10G10B10A2 layout; llvm-mc 15 encodes BUF_DATA_FORMAT_2_10_10_10 + UNORM as unified format 50.
  • Formats 44–49 and 51–55 stay refused.
  • The earlier thread replies saying format 50 "decodes the 2-bit X field first" don't match the code or docs/experiments.md. The code is the correct one.

Three things before merge:

  1. Cache revision. mubuf_format's run-time FORMAT switch gains case 50u in programs that already translate; 8 compute programs from the existing compute checks change. With the shim now accepting code 50, a cached shader from the current revision would return the 0x7fc0f0f0 sentinel. main is now at x2w-startup-shader-19 / 19cs (since #2708). Please move both to 20 / 20cs, or one past whatever lands first; the switch is emitted for every stage, so the graphics key moves too.
  2. Runtime-shim regression. tests/startup_buffer_format_word3_check.cpp doesn't list DXGI_FORMAT_R10G10B10A2_UNORM. Dropping case 50 from formatted_buffer.h, or the R10G10B10A2 line from buffer_format_word3.h, still passes that source-built check; only the text-parsing table checks fail. Please add it to decoded[], and check that view_word3 gives 50u << 12 | identity.
  3. Docs and description. docs/experiments.md still says no D3D12 draw has been run for the format, but startup_vertex_fetch_formats_warp / _hardware now read it back. The PR description still says Win2025 hasn't been run.

Runs: Windows 11 build 26300; AMD Radeon RX 9070 XT (driver 32.0.32029.2010); WARP 10.0.26100.9818.

  • At c2320749: ctest --preset dev -R "tbuffer|vertex_fetch_formats|buffer_format_word3|formatted" 12/12. Format 50 reads back at stride 6 / offset 2 and through the descriptor path with 0 mismatches, and its three mutations fail.
  • Neighbours: -R "startup_gfx2hlsl|startup_compute_|startup_mesh57_formatted" 386/389:
    • fma_mix_dispatch_hardware (#2746);
    • startup_compute_dispatch_texture_warp / _hardware, which pass once merged with current main.
  • On a local merge with main: startup_vertex_fetch_formats_* stop at a source gate. That gate also fails on main since #2596, unrelated to this PR (noted on #2596).
  • Mutants caught: x/z swapped, alpha from bit 31, SNORM accepted with the UNORM decode, descriptor code 50 → 51, and DXGI 24 dropped. The two shim mutants above survive the source-built check.

AI-assisted; commands listed were executed locally.

@R0Y00 R0Y00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebuilt the Release renderer and ran all seven format checks. Both WARP and RTX 4060 Laptop passed the packed format draws. The composed main extracts FORMAT and token handling through the shared word3 decoder, and the updated gate check catches clearing that check or skipping the decoder call. The packed normalization and field-order controls continue to run.

@MasterDomino

Copy link
Copy Markdown
Collaborator

@R0Y00, thanks. 6e9917f3 also fixes the vertex-preflight gate I reported on #2596, so startup_vertex_fetch_formats_* can run on a merge again.

My change request at c2320749 is still open on two points:

  1. Cache revision. mubuf_format's run-time FORMAT switch gains case 50u in programs that already translate; 8 existing compute programs from the compute checks change. A shader cached at 19 / 19cs before this lands therefore keeps the old switch. With the shim now accepting code 50, it would return the 0x7fc0f0f0 sentinel instead of the decoded value. The head still keys 19 / 19cs. Do you want the bump to 20 / 20cs here, or do you consider the stale entry acceptable? If you're fine without it, I'll dismiss my request.
  2. Source-built shim regression. tests/startup_buffer_format_word3_check.cpp still doesn't list DXGI_FORMAT_R10G10B10A2_UNORM. Dropping case 50 from formatted_buffer.h passes that C++ check; only the text-parsing checks fail. One row in decoded[] would pin it. The docs line about no D3D12 draw is minor.

AI-assisted.

…2 in the word3 check

Move x2w-startup-shader-19/19cs to 20/20cs (the run-time FORMAT switch gains
case 50), update the known-answer keys, add R10G10B10A2_UNORM to the decoded
formats and to the view_word3 identity check, and refresh the docs.

@MasterDomino MasterDomino left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving a2e70c73. My change request is resolved.

  • Cache revision: it moves to x2w-startup-shader-20 / 20cs. No 18 / 19 literal is left in src, tools or tests, apart from the fract check's historical seed comparison.
  • Source-built shim regression: startup_buffer_format_word3_check.cpp now covers DXGI_FORMAT_R10G10B10A2_UNORM. Dropping case 50 from formatted_buffer.h now fails it: FAIL DXGI format 24: code 50. Restored, it passes again.
  • Vertex preflight gate: R0Y00's 6e9917f3 fixed the gate, so the format-50 readback runs again on top of main.

Run at this head (Windows 11 build 26300, --preset dev; AMD Radeon RX 9070 XT, driver 32.0.32029.2010; WARP 10.0.26100.9818):

ctest --preset dev --no-tests=error -R 'buffer_format_word3|tbuffer|vertex_fetch_formats|shader_cache_key|compute_request_offline'

10/10 passed, including startup_vertex_fetch_formats_warp and _hardware and startup_gfx2hlsl_tbuffer_2101010.

AI-assisted; commands listed were executed locally.

@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

@MasterDomino all three points are fixed at a2e70c73d2b16e42a1bb0adbb016a37507f916da (on top of 6e9917f3).

  1. Cache revision. x2w-startup-shader-19 / 19cs moved to 20 / 20cs in gfx2hlsl.py, d3d12_draw.inl and the tests that spell the revision. The known-answer keys changed with it (startup_shader_cache_key_check.py, startup_compute_request_offline_check.py), and docs/startup-runtime.md says why revision 20 exists.
  2. Runtime-shim regression. tests/startup_buffer_format_word3_check.cpp lists DXGI_FORMAT_R10G10B10A2_UNORM in decoded[] and checks view_word3 gives 50u << 12 | identity. Dropping case 50 or the table line now fails the source-built check.
  3. Docs and description. docs/experiments.md now says startup_vertex_fetch_formats_warp / _hardware read the format back; the PR description is refreshed.

Win2025 (Windows Server 2025 build 26100, D3D12 WARP), ctest --preset dev and --preset release with -R '^(startup_gfx2hlsl_tbuffer_2101010|startup_buffer_format_word3|startup_vertex_fetch_formats_controls|startup_vertex_fetch_formats_warp|startup_shader_cache_key|startup_compute_request_offline)' --no-tests=error: 8/8 passed on both, including startup_buffer_format_word3, startup_buffer_format_word3_mapping_control, startup_buffer_format_word3_table, startup_gfx2hlsl_tbuffer_2101010 and startup_vertex_fetch_formats_warp.

Re-requesting review.

AI-assisted; commands listed were executed locally.

@tedin7
tedin7 requested a review from MasterDomino November 26, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants