Skip to content

shader: lower v_frexp, v_cvt_flr/rpi and v_ldexp in gfx2hlsl (Part of #1723) - #2079

Closed
tedin7 wants to merge 11 commits into
R0Y00:mainfrom
tedin7:x2w-b3-frexp-cvt-clean
Closed

tedin7 wants to merge 11 commits into
R0Y00:mainfrom
tedin7:x2w-b3-frexp-cvt-clean

Conversation

@tedin7

@tedin7 tedin7 commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #1723

What this unblocks: pixel shaders that use v_frexp_mant_f32, v_frexp_exp_i32_f32, v_cvt_flr_i32_f32, v_cvt_rpi_i32_f32 or v_ldexp_f32 no longer stop gfx2hlsl.py with "Unsupported"; they now lower to HLSL.
Source: AMD "RDNA 2" Instruction Set Architecture reference guide, instruction descriptions V_FREXP_MANT_F32, V_FREXP_EXP_I32_F32, V_CVT_FLR_I32_F32, V_CVT_RPI_I32_F32 (VOP1) and V_LDEXP_F32 (VOP3); Microsoft HLSL intrinsic reference, frexp and ldexp.

Changes:

  • tools/startup/gfx2hlsl.py: five new handlers.
    • frexp mantissa and exponent work on the bit pattern. Zero and denormals give a signed zero (exponent 0). Infinity and NaN pass through (exponent 0).
    • The two int conversions saturate to int32, and NaN reads 0. cvt_rpi is floor(x + 0.5).
    • ldexp clamps the shift to +-300 and scales in three parts, so no factor overflows binary32.
    • The int-result forms refuse output modifiers. The float-result forms accept clamp, mul and div.
  • tests/startup_gfx2hlsl_frexp_cvt_check.py: runs the emitted HLSL on the CPU against RDNA 2 ISA references. It is registered as startup_gfx2hlsl_frexp_cvt in CMakeLists.txt.
  • v_ldexp_f32 for the compute path is left to shader: lower compute v_ldexp_f32 #1918, which touches a different tool.

Verification:

  • python3 -B tests/startup_gfx2hlsl_frexp_cvt_check.py on the merged branch: gfx2hlsl frexp/cvt/ldexp check passed (36 inputs per unary op, 736 for ldexp).
  • python3 -B tests/startup_gfx2hlsl_frexp_cvt_warp_check.py: controls passed; ... draw <dxc> <offscreen_check> warp [fxc] draws every operation against references from Python doubles and a mutated lowering that must read other words.
  • Same check with gfx2hlsl.py from origin/main: fails with Unsupported: v_frexp_mant_f32.
  • Branch updated by merging current origin/main (three conflicts: CMakeLists.txt and docs/experiments.md kept both sides, gfx2hlsl.py kept both handler groups).
  • Win2025 WARP dev: pending (result added below). Release and independent review: pending Stage-2.

AI-assisted; commands listed were executed locally.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 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-26T05:46:07.415939Z 628685f Draft marked ready
ℹ️ 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: c455011555

ℹ️ 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 tools/startup/gfx2hlsl.py Resolved
Comment thread CMakeLists.txt Resolved
@tedin7
tedin7 force-pushed the x2w-b3-frexp-cvt-clean branch from c99d412 to 7f43681 Compare November 25, 2026 01:03
@thepatrickworld

Copy link
Copy Markdown
Contributor

Independent run on hardware. startup_gfx2hlsl_frexp_cvt_warp_check.py draw … hardware … exits 0 here, head 7f436813, with FXC and DXC: AMD Radeon RX 9070 XT, 1002:7550, driver 32.0.32029.2010, Windows 11 build 26200.9974. 148 pixel draws, no mismatch line; 11 of them carry a NaN operand and 16 a -INF, so the special cases the guide names are actually drawn rather than skipped. WARP passes in the same run.

The fixture is named for WARP but takes the adapter as an argument, so as far as I can tell this is its first run on a card. It covers what was missing from this PR: the translated frexp, cvt and ldexp under FXC and DXC on an adapter nobody had tried, including the sign-dependent NaN saturation and the cvt_rpi tie cases.

Limit. AMD only; there is no NVIDIA adapter on this machine. The expected side is this PR's own model, so what passes here is that the translation and the model agree on the card — not that the model is right about every clause of the guide. The parts I could check against the guide directly are the special-value clauses, and those are the ones carried in the inputs above.

AI-assisted; runs executed on the machine above.

@tedin7
tedin7 force-pushed the x2w-b3-frexp-cvt-clean branch 3 times, most recently from 9cbf365 to 3bf27cb Compare November 25, 2026 07:38
@Makto94

Makto94 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

tests/startup_gfx2hlsl_frexp_cvt_check.py fails at head 3bf27cbb on Python 3.12.0, 3.12.10 and 3.11.17. It passes on Python 3.14.8. The cause is in the evaluator of the check (see "Measured").

Failure (Windows x64, Python 3.12.0, 3.12.10 and 3.11.17)

Command, from the repository root: python -B tests/startup_gfx2hlsl_frexp_cvt_check.py (ctest name startup_gfx2hlsl_frexp_cvt).

v_frexp_mant_f32_e32: MISMATCH 0x7f800001 got 0x7fc00001 want 0x7f800001
v_frexp_mant_f32_e64: MISMATCH 0x7f800001 got 0x7fc00001 want 0x7f800001
v_frexp_mant_f32_e32: MISMATCH 0xff800001 got 0xffc00001 want 0xff800001
v_frexp_mant_f32_e64: MISMATCH 0xff800001 got 0xffc00001 want 0xff800001
FAILED: 4

Measured

  • startup_gfx2hlsl_frexp_cvt_controls and startup_gfx2hlsl_frexp_cvt_warp pass on the same head.

  • Cause: value() converts the word with struct.unpack('<f', ...). On these 3.11 and 3.12 builds the float32 to double step inside unpack sets the quiet bit of a signaling NaN (double 0x7ff8000020000000). bits() then returns 0x7fc00001. ref_frexp_mant returns the word unchanged for exponent 255, so want keeps the signaling NaN, while got passes through value() and bits().

  • Round trip with no repo code:
    import struct; print(hex(struct.unpack('<I', struct.pack('<f', struct.unpack('<f', struct.pack('<I', 0x7f800001))[0]))[0]))

    Python Output
    3.12.0 (venv) 0x7fc00001
    3.12.10 (uv) 0x7fc00001
    3.11.17 (uv) 0x7fc00001
    3.14.8 (uv) 0x7f800001
  • AGENTS.md asks for Python 3.11 or newer, so 3.11 and 3.12 are in the supported range.

  • Line 14 of the check says: "Not covered: denormal inputs and results of v_ldexp_f32 (the denormal mode decides them) and signaling-NaN payloads." The check still feeds 0x7f800001 and expects it to pass through.

  • Gates, from .github/workflows/windows.yml at this head:

    • On pull_request the job runs ctest --preset pr --no-tests=error ... (line 334). The pr preset in CMakePresets.json does not select startup_gfx2hlsl_frexp_cvt*, so the pull request job does not run this check.
    • On other events, including push to main, the job runs ctest --preset dev --no-tests=error --parallel 4 -E '_hardware$' ... (line 339). That selection includes startup_gfx2hlsl_frexp_cvt. The job is "Build and test on Windows" with python-version: '3.12' (line 286).
    • The pull request run of that job on this head used Python 3.12.10. 3.12.10 fails here, so I expect the push job to fail on this check after merge. I did not run the push job.
    • The Linux Python list in the same file does not contain this check. Linux was not measured.

Environment: Windows 11 build 26300; Python 3.12.0 (venv), 3.12.10, 3.11.17 and 3.14.8 (uv).

Suggestion (your call)

Option A: keep the word with the value. A sketch, tried in a scratch copy of the check:

+class F32(float):
+    """binary32 value that keeps its source word, so a signaling NaN survives F() -> U() (the double
+    conversion in struct.unpack('<f') sets the quiet bit)."""
+    word = None
+
+
 def bits(x):
+    if isinstance(x, F32) and x.word is not None:
+        return x.word
     return struct.unpack('<I', struct.pack('<f', x))[0]
 def value(word):
-    return struct.unpack('<f', struct.pack('<I', word & MASK))[0]
+    r = F32(struct.unpack('<f', struct.pack('<I', word & MASK))[0])
+    r.word = word & MASK
+    return r

Result with this change: 4 mismatches become 0 on 3.12.0 and 3.11.17. The scratch copy still passes on 3.14.8. The check still catches translator mutations:

  • 0x3f000000u changed to 0x3f800000u in op_v_frexp_mant_f32: FAILED: 68.
  • NaN/Inf passthrough removed: FAILED: 16.

Option B: state a minimum Python version for this check. This needs a docs change and leaves 3.11 and 3.12 users with a failing test.

I ran no hardware (_hardware) test for this comment.

@Makto94

Makto94 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

startup_gfx2hlsl_frexp_cvt_hardware fails on an RTX 3070 Ti at head 3bf27cbb. On the same head, startup_gfx2hlsl_frexp_cvt_warp passes on WARP. The failure is in v_ldexp_f32, pixel 4, lane 2: the NaN input reads back as 7fffffff where the check expects 7fc00000. This is a separate result from my earlier comment on the CPU check.

Command (Windows 11 build 26300.9974, Debug build, serial run on an idle machine)

.\tools\dev.ps1; ctest --preset dev --no-tests=error -j1 -R '^startup_gfx2hlsl_frexp_cvt_hardware$' -V

Environment: NVIDIA GeForce RTX 3070 Ti (10de:2482), driver 32.0.16.2101; fxc 10.0.26100.9457; dxc 1.9.2602.17; D3D12 debug layer enabled. 0 capability skips (77).

Observed

Every v_frexp_mant_f32, v_frexp_exp_i32_f32, v_cvt_flr_i32_f32 and v_cvt_rpi_i32_f32 pixel matches, and so do v_ldexp_f32 pixels 0 to 3. Then:

AssertionError: fxc v_ldexp_f32 pixel 4 expected 7f800000,ff800000,7fc00000,41400000
startup_flat_param mismatch expected=7f800000,ff800000,7fc00000,41400000 actual=7f800000,ff800000,7fffffff,41400000
debug_errors=0 debug_warnings=0

Pixel 4 takes (+inf, 3), (-inf, -3), (NaN 0x7fc00000, 7) and (3.0, 2) as (value, exponent) (LDEXP_INPUTS[16:20]). Lanes 0, 1 and 3 match. Lane 2, the NaN lane, reads 7fffffff. The reference (ref_ldexp) returns the input word unchanged for a NaN.

FXC and DXC read the same words. I ran the draw check again without the fxc argument (the ctest command line minus its last argument):

python -B tests/startup_gfx2hlsl_frexp_cvt_warp_check.py draw <dxc.exe> <offscreen_check.exe> hardware

DXC stops at the same place with the same actual words:

AssertionError: dxc v_ldexp_f32 pixel 4 expected 7f800000,ff800000,7fc00000,41400000
startup_flat_param words=7f800000,ff800000,7fffffff,41400000
debug_errors=0 debug_warnings=0

7fffffff is also a NaN, with a different payload than 7fc00000. So the NaN class is kept and the word is not.

Lowering involved (op_v_ldexp_f32, tools/startup/gfx2hlsl.py): the NaN is multiplied by three exp2 factors:

expr = '((%s * exp2(float(%s))) * exp2(float(%s))) * exp2(float(%s))' % (self.f(ops[1]), a, b, c)

where a, b and c split the clamped exponent in three parts. I did not read the compiled shader, so I do not know which operation produces 7fffffff.

Limits

  • WARP on this head passes (startup_gfx2hlsl_frexp_cvt_warp, fxc and dxc). This result is for this adapter only. I did not measure AMD on this head; the earlier hardware run in this thread was on 7f436813.
  • Pixel 4 is the last v_ldexp_f32 pixel (20 inputs, 5 pixels), and v_ldexp_f32 is the last op in OPS, so the stop skipped no pixel.
  • Debug layer: debug_errors=0 debug_warnings=0 in every run.

I do not propose a fix here.

@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @Makto94, the analysis was exact.

Head 5e3ca3e3 applies Option A for the CPU check tests/startup_gfx2hlsl_frexp_cvt_check.py. The check now keeps the original NaN word next to the decoded value. The expected and actual sides no longer go through a float32-to-double round trip, so the signaling NaN words (0x7f800001, 0xff800001) are compared as the original bit patterns. This no longer depends on the Python build.

Verified on Windows Server 2025 (D3D12 WARP) at 5e3ca3e3:

  • Debug: ctest --preset dev -R 'frexp_cvt' --parallel 2 --no-tests=error --output-on-failure gave 4/4 passed (startup_gfx2hlsl_frexp_cvt, _controls, _warp, _hardware).
  • Release: ctest --preset release -R 'frexp_cvt' --parallel 2 --no-tests=error --output-on-failure gave 4/4 passed.

This reply covers only your first report (the CPU check). Your RTX 3070 Ti report on v_ldexp_f32 (NaN lane reading 7fffffff) is a separate item. I did not reproduce it on this WARP node, so it is not claimed as fixed here.

AI-assisted; commands listed were executed locally.

@Makto94

Makto94 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Re-tested the new head 5e3ca3e3 against my two earlier reports at 3bf27cbb (CPU check, hardware v_ldexp_f32). The new commit makes the CPU check keep each value's source word (F32) and makes the v_ldexp_f32 lowering return a NaN source word unchanged.

CPU: python -B tests/startup_gfx2hlsl_frexp_cvt_check.py prints "gfx2hlsl frexp/cvt/ldexp check passed" with exit 0 on Python 3.11.17, 3.12.0, 3.12.10 and 3.14.8 (Windows x64). 3.12.10 is the version in the Windows CI job, so my earlier prediction for the main push job no longer applies to this head.

WARP and controls (startup_gfx2hlsl_frexp_cvt, _controls, _warp):

100% tests passed, 0 tests failed out of 3

Hardware: .\tools\dev.ps1; ctest --preset dev --no-tests=error -j1 -R '^startup_gfx2hlsl_frexp_cvt_hardware$' -V passes. The case that read 7fffffff before no longer reproduces here:

fxc v_ldexp_f32 pixel 4: 7f800000,ff800000,7fc00000,41400000
dxc v_ldexp_f32 pixel 4: 7f800000,ff800000,7fc00000,41400000

All 148 debug_errors= lines read debug_errors=0 debug_warnings=0, and there were 0 capability skips (77). Environment: NVIDIA GeForce RTX 3070 Ti (10de:2482), driver 32.0.16.2101, Windows 11 build 26300.9974, Debug build (binaries built at 3bf27cbb; 5e3ca3e3 changes two Python files only), fxc 10.0.26100.9457, dxc 1.9.2602.17, D3D12 debug layer enabled; serial run on an idle machine. I have not measured AMD or Intel on this head.

@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Correction to my earlier comment: head 5e3ca3e3 also includes the fix for your RTX 3070 Ti report. op_v_ldexp_f32 in tools/startup/gfx2hlsl.py now returns a NaN source word unchanged instead of multiplying it by the exp2 factors (the 7fffffff readback).
I could not reproduce the hardware result here (WARP only), so please re-run startup_gfx2hlsl_frexp_cvt_hardware on your RTX 3070 Ti at 5e3ca3e3. The Linux tests/startup_gfx2hlsl_*_check.py checks pass on that head.

AI-assisted; commands listed were executed locally.

…d ldexp in gfx2hlsl

Part of R0Y00#1723

Adds v_frexp_mant_f32, v_frexp_exp_i32_f32, v_cvt_flr_i32_f32, v_cvt_rpi_i32_f32 and v_ldexp_f32 to the pixel-stage lowering, with a pure-Python check registered in CMake.
…s for startup frexp/cvt/ldexp (Part of R0Y00#1723)

v_cvt_flr/rpi now read 0x7fffffff for a positive NaN and 0x80000000 for a negative one, and v_cvt_rpi adds 1 to floor(x) from the exact fraction instead of binary32 x + 0.5. The CPU evaluator rounds binary32 add/sub, the reference table gains the 0x3effffff, 2^23+1 and NaN rows, and docs/experiments.md describes the startup lowering and its check.
…NaN word in the CPU check (Part of R0Y00#1723)

An RTX 3070 Ti read a NaN times the exp2 factors back as 0x7fffffff, not the input word the ISA returns. A NaN source is now passed through unchanged. The CPU check lost the signaling NaN word to the quiet-bit change of struct.unpack on Python 3.11 and 3.12, so values now carry their word.
@tedin7
tedin7 force-pushed the x2w-b3-frexp-cvt-clean branch from 5e3ca3e to 4807377 Compare November 25, 2026 11:11
@Makto94

Makto94 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

RTX 3070 Ti run on head 48073779. Your 11:00Z request named 5e3ca3e3; that run was already posted at 10:55Z: #2079 (comment)

Hardware: .\tools\dev.ps1; ctest --preset dev --no-tests=error -j1 -R '^startup_gfx2hlsl_frexp_cvt_hardware$' -V passes:

fxc v_ldexp_f32 pixel 4: 7f800000,ff800000,7fc00000,41400000
dxc v_ldexp_f32 pixel 4: 7f800000,ff800000,7fc00000,41400000

No debug_errors= line is non-zero, and there were 0 capability skips (77). CPU, control and WARP tests (startup_gfx2hlsl_frexp_cvt, _controls, _warp): 100% tests passed, 0 tests failed out of 3.

Environment: NVIDIA GeForce RTX 3070 Ti (10de:2482), driver 32.0.16.2101, Windows 11 build 26300.9974, Debug build (binaries built at 48073779), fxc 10.0.26100.9457, dxc 1.9.2602.17, D3D12 debug layer enabled; the hardware run was serial on an idle machine.

@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Thank you @Makto94 for the RTX 3070 Ti run at 48073779: hardware passed with 0 non-zero debug_errors, CPU/controls/WARP 3/3. Recorded as extra evidence for this PR.

AI-assisted; commands listed were executed locally.

@thepatrickworld

Copy link
Copy Markdown
Contributor

Head 48073779, backend hardware, both compilers, on the AMD adapter (adapter=AMD Radeon RX 9070 XT vendor=1002 device=7550).

Five operations — v_frexp_mant_f32, v_frexp_exp_i32_f32, v_cvt_flr_i32_f32, v_cvt_rpi_i32_f32 and v_ldexp_f32 — give 37 readback lines and 5 mutation runs per compiler; four of the five print 8 readbacks each, v_ldexp_f32 prints 5. Every comparison held (exit 0 under both compilers), and every mutation line reports pixels reading other words: 8, 8, 5, 3 and 5, the smallest being v_cvt_rpi_i32_f32.

fxc v_ldexp_f32 pixel 4: 7f800000,ff800000,7fc00000,41400000
dxc v_ldexp_f32 pixel 4: 7f800000,ff800000,7fc00000,41400000
dxc v_ldexp_f32 mutation: 5 pixels read other words

That line is the interesting one for v_ldexp_f32: +inf, -inf and a NaN are in the reference words and come out unchanged under both compilers, alongside a finite input that moves.

AI-assisted.

@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Thank you @thepatrickworld for the AMD Radeon RX 9070 XT run (1002:7550).

You ran head 48073779, and that is the current head. Both fxc and dxc passed startup_gfx2hlsl_frexp_cvt_hardware: every comparison held and every mutation run read other words (8, 8, 5, 3, 5). The v_ldexp_f32 readback 7f800000,ff800000,7fc00000,41400000 matches the CPU reference, so +inf, -inf and NaN pass through unchanged on AMD too.

This is a PASS with no code change. With the earlier RTX 3070 Ti run at the same head, the hardware evidence now covers NVIDIA and AMD. No commit is pending.

AI-assisted; commands listed were executed locally.

@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target api_trace_check archive_all_lifted archive_codec archive_codec_gpu archive_codec_lifted archive_directory_gpu archive_directory_lifted archive_reader_lifted archive ... (cut, ~1055 names in total)): 573.22s (configure 1.71s)
    • Test (ctest --preset dev -R '^(startup_gfx2hlsl_.*|pixel_aot_.*_warp|compute_store_aot_.*_warp|form_coverage)$' --parallel 2 --no-tests=error --output-on-failure): 298/298 passed (430.01s: startup_gfx2hlsl_f32_sdwa_hardware 19.64s, compute_store_aot_descriptor_load_format_warp 36.21s, startup_gfx2hlsl_f32_sdwa_warp 23.46s, form_coverage 15.04s, startup_gfx2hlsl_f32_nan_hardware 12.93s, pixel_aot_compare_warp 13.83s, startup_gfx2hlsl_f32_nan_warp 22.53s, pixel_aot_bits_warp 16.03s, pixel_aot_cmpx_regions_warp 8.16s, pixel_aot_comparisons_warp 9.66s, pixel_aot_blend_scalar_warp 9.82s, startup_gfx2hlsl_cvt_alu_hardware 5.99s, pixel_aot_buffer_color_warp 13.24s, pixel_aot_cvt_f64_f32_warp 18.56s, startup_gfx2hlsl_bit_alu_hardware 6.84s, pixel_aot_three_way_warp 13.91s, pixel_aot_cvt_int_f64_warp 15.56s, pixel_aot_e64_warp 6.99s, startup_gfx2hlsl_frexp_cvt_warp 12.97s, startup_gfx2hlsl_frexp_cvt_hardware 13.09s, compute_store_aot_heap_view_load_warp 19.27s, pixel_aot_predicate_rounding_warp 18.76s, compute_store_aot_guard_read_warp 8.56s, compute_store_aot_lds_private_warp 5.91s, compute_store_aot_lds_qword_warp 8.07s, pixel_aot_core_vector_warp 8.00s, startup_gfx2hlsl_bit_alu_warp 7.52s, compute_store_aot_lds_arithmetic_warp 10.11s, pixel_aot_gather_warp 10.06s, startup_gfx2hlsl_f32_lg_warp 16.90s, startup_gfx2hlsl_cvt_alu_warp 20.54s, pixel_aot_f16_arith_warp 22.44s, compute_store_aot_mimg_packed_warp 7.83s, startup_gfx2hlsl_f32_lg_hardware 4.75s, compute_store_aot_mimg_load_warp 4.98s, compute_store_aot_mimg_mip_warp 5.01s, pixel_aot_cmpx_e64_warp 6.47s, pixel_aot_cvt_flr_rpi_warp 7.06s, pixel_aot_compare_gather_warp 4.11s, compute_store_aot_mubuf_store_format_warp 2.54s, compute_store_aot_lds_f32_warp 4.62s, pixel_aot_u32_from_f32_warp 1.43s, pixel_aot_sample_lod_warp 1.77s, startup_gfx2hlsl_shift64_hardware 3.30s, compute_store_aot_lds_packed_warp 3.12s, pixel_aot_exec_regions_warp 6.49s, startup_gfx2hlsl_f32_nan 7.01s, startup_gfx2hlsl_mad_dispatch_hardware 1.70s, pixel_aot_cmp_f64_warp 5.02s, compute_store_aot_mimg_resinfo_warp 2.45s, compute_store_aot_mubuf_counter_warp 1.44s, pixel_aot_cvt_f64_int_warp 3.65s, pixel_aot_cmp64_warp 3.55s, startup_gfx2hlsl_shift64_warp 3.54s, pixel_aot_compare_sample_warp 3.41s, pixel_aot_f16_round_warp 4.95s, compute_store_aot_lds_replacement_warp 3.47s, compute_store_aot_lds_strided_warp 1.98s, compute_store_aot_heap_view_store_warp 8.92s, compute_store_aot_alu_mad_i24_warp 1.58s, compute_store_aot_mubuf_reduction_warp 3.07s, compute_store_aot_mimg_store_packed_warp 2.96s, compute_store_aot_mimg_store_warp 2.89s, compute_store_aot_alu_xor3_warp 2.05s, compute_store_aot_mtbuf_store_warp 2.97s, compute_store_aot_mtbuf_load_warp 3.14s, pixel_aot_sample_coarse_gradient_warp 3.19s, pixel_aot_f16_fmac_ldexp_warp 4.24s, compute_store_aot_lane_mask_warp 2.34s, startup_gfx2hlsl_s_lshl_add 5.25s, compute_store_aot_mimg_atomic_counter_warp 2.65s, compute_store_aot_f32_warp 2.35s, compute_store_aot_mubuf_store_subword_warp 2.09s, compute_store_aot_salu_absdiff_warp 1.16s, compute_store_aot_scratch_base_warp 1.55s, startup_gfx2hlsl_cmp_class_f16 5.18s, compute_store_aot_mubuf_reduction_x2_warp 2.84s, compute_store_aot_mimg_atomic_float_warp 2.15s, startup_gfx2hlsl_vopc_sdwa 5.96s, compute_store_aot_mubuf_exchange_warp 1.44s, compute_store_aot_mubuf_d16_warp 2.20s, compute_store_aot_gfx1013_image_atomics_warp 1.75s, compute_store_aot_mubuf_load_format_d16_warp 1.62s, pixel_aot_shift64_warp 4.20s, startup_gfx2hlsl_sdwa_cvt_hardware 1.75s, compute_store_aot_gfx1013_image_store_d16_warp 0.84s, compute_store_aot_mubuf_counter-x2_warp 1.35s, startup_gfx2hlsl_sop2_complement 4.61s, startup_gfx2hlsl_cmp_class 5.09s, compute_store_aot_alu_med3_warp 1.29s, compute_store_aot_writelane_warp 1.38s, compute_store_aot_vadd_nc_i32_warp 1.35s, compute_store_aot_alu_bcnt_warp 1.71s, compute_store_aot_lds_wide_replacement_warp 1.95s, compute_store_aot_alu_minmax3_warp 1.61s, compute_store_aot_alu_cvt_pk_u8_warp 1.58s, pixel_aot_dmask_warp 1.40s, compute_store_aot_ds_route_warp 1.25s, pixel_aot_sample_gradient_warp 2.31s, startup_gfx2hlsl_dpp_pair_hardware 1.74s, compute_store_aot_ff1_scalar_warp 1.36s, startup_gfx2hlsl_scalar_m0_hardware 1.04s, pixel_aot_sample_offset_warp 1.82s, compute_store_aot_mubuf_format_warp 1.62s, pixel_aot_rndne_warp 1.36s, compute_store_aot_mubuf_store_format_xyz_warp 1.14s, compute_store_aot_mubuf_vector_warp 1.59s, compute_store_aot_mimg_atomic_minmax_warp 1.78s, compute_store_aot_gfx1013_image_store_warp 0.89s, compute_store_aot_add_co_warp 1.22s, startup_gfx2hlsl_mad_preserve_hardware 0.95s, pixel_aot_dpp_f16_warp 4.05s, pixel_aot_dpp_extra_warp 3.16s, startup_gfx2hlsl_mad_dispatch_warp 1.43s, compute_store_aot_ff1_exec_warp 1.17s, compute_store_aot_bcnt_exec_warp 1.16s, pixel_aot_attribute_warp 0.80s, compute_store_aot_mubuf_subword_warp 1.67s, compute_store_aot_dpp_warp 0.97s, compute_store_aot_mubuf_exchange-x2_warp 1.25s, pixel_aot_get_lod_warp 1.54s, compute_store_aot_readlane_warp 1.13s, compute_store_aot_mimg_atomic_integer_warp 1.61s, compute_store_aot_descriptor_store_format_warp 1.78s, compute_store_aot_mimg_atomic_exchange_warp 1.22s, compute_store_aot_mbcnt_warp 1.43s, compute_store_aot_mubuf_csub_warp 1.15s, startup_gfx2hlsl_dpp_quad_swap_hardware 1.74s, compute_store_aot_bfe_warp 1.32s, compute_store_aot_cvt_u32_f32_warp 1.35s, compute_store_aot_mimg_msaa_warp 1.06s, compute_store_aot_desc_numeric_warp 1.17s, compute_store_aot_salu_i32_warp 1.40s, compute_store_aot_mac_f32_warp 1.30s, startup_gfx2hlsl_vopc_sdwa_warp 1.19s, pixel_aot_int16_ternary_warp 2.94s, startup_gfx2hlsl_dpp_pair_warp 1.72s, compute_store_aot_dot_u_warp 1.26s, startup_gfx2hlsl_vopc_sdwa_hardware 1.15s, compute_store_aot_alu_lane_gaps_warp 1.59s, startup_gfx2hlsl_scalar_m0_warp 1.09s, startup_gfx2hlsl_sgpr_spill_hardware 0.85s, compute_store_aot_sub_co_warp 1.33s, startup_gfx2hlsl_dpp_quad_swap_warp 1.80s, startup_gfx2hlsl_sdwa_cvt_warp 1.74s, pixel_aot_f16_cvt_int16_warp 2.57s, pixel_aot_region_body_warp 2.32s, pixel_aot_scc_skip_warp 2.00s, compute_store_aot_vcmp_select_warp 2.37s, pixel_aot_cvt_f32_f64_warp 2.08s, startup_gfx2hlsl_watch 2.50s, pixel_aot_cvt_float_int_e64_warp 2.21s, pixel_aot_dpp_cvt_warp 2.54s, startup_gfx2hlsl_cvt_pk_u8_hardware 0.69s, pixel_aot_s_call_warp 1.42s, pixel_aot_region_scalar_load_warp 1.78s, startup_gfx2hlsl_f32_sdwa 2.45s, startup_gfx2hlsl_compute_hardware 1.33s, pixel_aot_int16_vop3_warp 1.94s, pixel_aot_div_fmas_warp 1.67s, pixel_aot_pk_fmac_warp 2.17s, pixel_aot_f16_to_int16_warp 2.06s, pixel_aot_plain_movrel_warp 1.98s, pixel_aot_bitset64_warp 2.09s, pixel_aot_plain_bitscan_warp 1.86s, startup_gfx2hlsl_dpp_quad_broadcast_hardware 0.93s, startup_gfx2hlsl_interp_f16_hardware 0.80s, pixel_aot_vop3_ternary_int_warp 1.92s, pixel_aot_align_warp 1.86s, pixel_aot_flat_scratch_warp 1.67s, pixel_aot_bfm_warp 1.27s, pixel_aot_first_bit_warp 1.63s, pixel_aot_e64_integer_warp 1.33s, startup_gfx2hlsl_mad_preserve_warp 0.92s, pixel_aot_mad64_warp 1.51s, pixel_aot_dpp_movrel_warp 1.52s, startup_gfx2hlsl_compute_warp 1.33s, startup_gfx2hlsl_dpp_quad_broadcast_warp 0.82s, pixel_aot_sdwa_integer_warp 1.53s, pixel_aot_sdwa_movrel_warp 1.48s, pixel_aot_sdwa_unary_warp 1.38s, pixel_aot_swap_warp 1.41s, pixel_aot_carry_in_warp 1.44s, pixel_aot_uncompressed_export_warp 1.41s, pixel_aot_smovrel_warp 1.40s, pixel_aot_uncompressed_integer_export_warp 1.33s, pixel_aot_swaprel_warp 1.32s, pixel_aot_region_waits_warp 1.49s, pixel_aot_brev_warp 1.39s, pixel_aot_integer_nc_warp 1.31s, pixel_aot_mac_legacy_warp 1.59s, pixel_aot_region_scalar_alu_warp 1.49s, startup_gfx2hlsl_cmp16_warp 1.77s, pixel_aot_sad_warp 1.49s, pixel_aot_e64_spellings_warp 1.41s, pixel_aot_carry_out_warp 1.31s, compute_store_aot_gfx1013_gather4_l_warp 1.57s, pixel_aot_sdwa_cmp_warp 1.46s, pixel_aot_frexp_exp_warp 1.25s, startup_gfx2hlsl_f32_lg 1.31s, pixel_aot_pack_int16_warp 1.14s, pixel_aot_e64_approx_warp 1.13s, pixel_aot_ds_swizzle_warp 1.16s, pixel_aot_title_loads_warp 1.32s, startup_gfx2hlsl_cvt_pk_u8_warp 0.68s, pixel_aot_compressed_export_warp 1.20s, pixel_aot_pack_b32_warp 1.13s, pixel_aot_sopk_hwreg_warp 1.05s, pixel_aot_smem_pointers_warp 1.21s, startup_gfx2hlsl_interp_f16_warp 0.78s, startup_gfx2hlsl_compute_b-offset_hardware 0.24s, startup_gfx2hlsl_capture 0.99s, startup_gfx2hlsl_compute_dropped-store_hardware 0.25s, startup_gfx2hlsl_compute_c-unpredicated_hardware 0.28s, startup_gfx2hlsl_compute_swapped-axes_hardware 0.26s, pixel_aot_vop1_nops_warp 1.06s, startup_gfx2hlsl_sgpr_spill_warp 0.85s, startup_gfx2hlsl_compute_dropped-store_warp 0.26s, pixel_aot_sopp_round_mode_warp 1.09s, startup_gfx2hlsl_compute_c-unpredicated_warp 0.26s, startup_gfx2hlsl_compute_swapped-axes_warp 0.24s, startup_gfx2hlsl_compute_b-offset_warp 0.26s, pixel_aot_attribute_sampled_warp 0.66s, startup_gfx2hlsl_compute_mbcnt_warp 0.64s, startup_gfx2hlsl_compute_controls 0.46s, startup_gfx2hlsl_root 0.73s, startup_gfx2hlsl_sopk_accum 0.89s, compute_store_aot_gfx1013_image_uav_load_warp 0.77s, startup_gfx2hlsl_sdwa 0.17s, startup_gfx2hlsl_bit_alu_controls 0.72s, startup_gfx2hlsl_frexp_cvt 0.62s, startup_gfx2hlsl_sample_c_lz_mip 0.17s, startup_gfx2hlsl_join_symbols_warp 0.35s, startup_gfx2hlsl_refusals 0.49s, startup_gfx2hlsl_compute_f-peer_warp 0.25s, startup_gfx2hlsl_scalar_m0_controls 0.11s, startup_gfx2hlsl_compute_f-broadcast_warp 0.27s, startup_gfx2hlsl_swap 0.27s, startup_gfx2hlsl_sdwa_cvt 0.29s, startup_gfx2hlsl_mad_controls 0.13s, startup_gfx2hlsl_join_symbols_controls 0.21s, startup_gfx2hlsl_operand_count 0.19s, startup_gfx2hlsl_interp_f16_controls 0.20s, startup_gfx2hlsl_dpp_quad_swap_controls 0.13s, startup_gfx2hlsl_sopk_signext 0.15s, startup_gfx2hlsl_dpp_pair 0.14s, startup_gfx2hlsl_dpp_quad_broadcast 0.14s, startup_gfx2hlsl_export_mask 0.14s, startup_gfx2hlsl_cvt_alu_controls 0.16s, startup_gfx2hlsl_add_sub_co_controls 0.14s, startup_gfx2hlsl_compute_g-overlap_warp 0.27s, startup_gfx2hlsl_compute_h-inner-unpredicated_warp 0.27s, startup_gfx2hlsl_compute_j-scalar-dropped_warp 0.28s, startup_gfx2hlsl_compute_g-swapped-offsets_warp 0.28s, startup_gfx2hlsl_sgpr_spill_controls 0.11s, startup_gfx2hlsl_shift64_controls 0.14s, startup_gfx2hlsl_s_sext_cmov 0.10s, startup_gfx2hlsl_frexp_cvt_controls 0.12s, startup_gfx2hlsl_export_mask_drop_control 0.12s, startup_gfx2hlsl_compute_k-block-entered_warp 0.24s, startup_gfx2hlsl_scalar_shift64_bfe_controls 0.19s, startup_gfx2hlsl_cvt_pk_u8_controls 0.11s, startup_gfx2hlsl_int_med3_controls 0.12s, startup_gfx2hlsl_cmp16_controls 0.25s, startup_gfx2hlsl_readfirstlane_uniform 0.12s, startup_gfx2hlsl_s_bitcmp 0.11s, startup_gfx2hlsl_cselect_mask_controls 0.11s, startup_gfx2hlsl_readfirstlane_recompute 0.11s, startup_gfx2hlsl_handler_arity 0.11s, startup_gfx2hlsl_smem_offset 0.10s, startup_gfx2hlsl_b64_shift 0.10s, startup_gfx2hlsl_op_refusals 0.09s, startup_gfx2hlsl_mask_overwrite_controls 0.11s, startup_gfx2hlsl_neg_operand 0.10s, startup_gfx2hlsl_tbuffer_16f 0.10s, startup_gfx2hlsl_cndmask_neg 0.10s, startup_gfx2hlsl_calculated_target 0.11s, startup_gfx2hlsl_join_symbols_folded_warp 0.20s, startup_gfx2hlsl_vcvt_omod 0.10s, startup_gfx2hlsl_opsel 0.10s, startup_gfx2hlsl_loop_constants 0.11s, startup_gfx2hlsl_saveexec_same_reg_controls 0.11s, startup_gfx2hlsl_scalar_brev_fold 0.12s, startup_gfx2hlsl_image_get_lod_controls 0.11s, startup_gfx2hlsl_compare_dst_controls 0.10s, startup_gfx2hlsl_image_arity 0.09s, startup_gfx2hlsl_draw_skip 0.47s, startup_gfx2hlsl_compute_mbcnt_hardware 0.69s, startup_gfx2hlsl_compute_f-peer_hardware 0.29s, startup_gfx2hlsl_compute_f-broadcast_hardware 0.27s, startup_gfx2hlsl_cmp16_hardware 1.83s, startup_gfx2hlsl_compute_g-swapped-offsets_hardware 0.26s, startup_gfx2hlsl_compute_g-overlap_hardware 0.23s, startup_gfx2hlsl_compute_j-scalar-dropped_hardware 0.23s, startup_gfx2hlsl_compute_h-inner-unpredicated_hardware 0.24s, startup_gfx2hlsl_compute_k-block-entered_hardware 0.24s, startup_gfx2hlsl_join_symbols_folded_hardware 0.20s, startup_gfx2hlsl_join_symbols_hardware 0.34s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target api_trace_check archive_all_lifted archive_codec archive_codec_gpu archive_codec_lifted archive_directory_gpu archive_directory_lifted archive_reader_lifted arc ... (cut, ~1055 names in total)): 394.41s (configure 2.20s)
    • Test (ctest --preset release -R '^(startup_gfx2hlsl_.*|pixel_aot_.*_warp|compute_store_aot_.*_warp|form_coverage)$' --parallel 2 --no-tests=error --output-on-failure): 298/298 passed (295.03s: startup_gfx2hlsl_f32_sdwa_hardware 14.56s, compute_store_aot_descriptor_load_format_warp 20.20s, startup_gfx2hlsl_f32_nan_hardware 12.96s, form_coverage 11.43s, startup_gfx2hlsl_f32_sdwa_warp 13.15s, startup_gfx2hlsl_f32_nan_warp 9.45s, pixel_aot_cmpx_e64_warp 4.11s, startup_gfx2hlsl_cvt_alu_hardware 4.17s, pixel_aot_compare_warp 16.74s, pixel_aot_three_way_warp 11.29s, startup_gfx2hlsl_bit_alu_hardware 5.82s, startup_gfx2hlsl_f32_lg_hardware 3.37s, startup_gfx2hlsl_frexp_cvt_warp 9.09s, pixel_aot_core_vector_warp 13.15s, pixel_aot_buffer_color_warp 11.00s, pixel_aot_bits_warp 22.29s, startup_gfx2hlsl_mad_dispatch_hardware 1.21s, pixel_aot_cmpx_regions_warp 5.39s, startup_gfx2hlsl_sdwa_cvt_hardware 1.44s, startup_gfx2hlsl_frexp_cvt_hardware 9.25s, pixel_aot_blend_scalar_warp 6.57s, startup_gfx2hlsl_shift64_hardware 2.50s, pixel_aot_cvt_f64_f32_warp 5.73s, pixel_aot_sample_lod_warp 1.26s, startup_gfx2hlsl_f32_lg_warp 3.27s, compute_store_aot_guard_read_warp 5.23s, compute_store_aot_lds_arithmetic_warp 4.54s, pixel_aot_comparisons_warp 6.27s, startup_gfx2hlsl_bit_alu_warp 4.67s, pixel_aot_region_body_warp 1.90s, pixel_aot_compare_gather_warp 2.66s, compute_store_aot_lds_qword_warp 4.91s, pixel_aot_exec_regions_warp 4.46s, startup_gfx2hlsl_mad_preserve_hardware 0.75s, compute_store_aot_mimg_mip_warp 3.61s, compute_store_aot_mimg_load_warp 3.61s, pixel_aot_region_waits_warp 1.09s, startup_gfx2hlsl_cvt_alu_warp 4.17s, startup_gfx2hlsl_sdwa_cvt_warp 1.41s, compute_store_aot_lds_f32_warp 3.17s, compute_store_aot_lds_private_warp 3.66s, compute_store_aot_heap_view_load_warp 5.32s, pixel_aot_predicate_rounding_warp 4.19s, pixel_aot_dpp_extra_warp 2.55s, compute_store_aot_alu_cvt_pk_u8_warp 1.30s, compute_store_aot_lds_packed_warp 2.25s, startup_gfx2hlsl_sop2_complement 3.81s, startup_gfx2hlsl_shift64_warp 2.43s, pixel_aot_dpp_cvt_warp 2.00s, compute_store_aot_mubuf_reduction_warp 2.03s, compute_store_aot_mubuf_d16_warp 1.74s, compute_store_aot_mimg_packed_warp 2.98s, compute_store_aot_lds_replacement_warp 2.26s, startup_gfx2hlsl_f32_nan 4.53s, pixel_aot_f16_arith_warp 4.75s, startup_gfx2hlsl_cmp_class 3.95s, startup_gfx2hlsl_vopc_sdwa 3.96s, pixel_aot_sample_coarse_gradient_warp 1.92s, compute_store_aot_mtbuf_store_warp 2.01s, pixel_aot_e64_warp 4.67s, compute_store_aot_alu_mad_i24_warp 1.05s, pixel_aot_f16_round_warp 3.35s, startup_gfx2hlsl_cmp_class_f16 3.65s, compute_store_aot_lane_mask_warp 1.61s, pixel_aot_cvt_flr_rpi_warp 4.44s, compute_store_aot_mubuf_subword_warp 1.45s, pixel_aot_compare_sample_warp 2.31s, compute_store_aot_mimg_atomic_integer_warp 1.34s, compute_store_aot_mubuf_store_subword_warp 1.51s, compute_store_aot_mubuf_store_format_warp 1.69s, compute_store_aot_mubuf_reduction_x2_warp 1.99s, startup_gfx2hlsl_dpp_pair_hardware 1.41s, compute_store_aot_mimg_store_packed_warp 1.98s, pixel_aot_sample_gradient_warp 1.89s, pixel_aot_cvt_int_f64_warp 3.78s, compute_store_aot_mtbuf_load_warp 1.96s, compute_store_aot_mimg_store_warp 1.92s, pixel_aot_gather_warp 2.82s, compute_store_aot_scratch_base_warp 1.18s, compute_store_aot_mimg_atomic_counter_warp 1.69s, compute_store_aot_mubuf_exchange-x2_warp 1.14s, compute_store_aot_mimg_atomic_float_warp 1.54s, compute_store_aot_mimg_resinfo_warp 1.69s, compute_store_aot_heap_view_store_warp 6.28s, startup_gfx2hlsl_scalar_m0_hardware 0.88s, startup_gfx2hlsl_s_lshl_add 3.18s, compute_store_aot_mbcnt_warp 1.14s, compute_store_aot_alu_minmax3_warp 1.28s, compute_store_aot_alu_bcnt_warp 1.38s, compute_store_aot_desc_numeric_warp 0.94s, compute_store_aot_f32_warp 1.57s, compute_store_aot_lds_wide_replacement_warp 1.54s, pixel_aot_cmp_f64_warp 3.25s, compute_store_aot_cvt_u32_f32_warp 1.11s, compute_store_aot_gfx1013_image_store_warp 0.69s, compute_store_aot_alu_xor3_warp 1.35s, compute_store_aot_mubuf_load_format_d16_warp 1.32s, compute_store_aot_mubuf_format_warp 1.31s, compute_store_aot_mimg_msaa_warp 0.86s, compute_store_aot_salu_absdiff_warp 0.94s, pixel_aot_sample_offset_warp 1.48s, compute_store_aot_lds_strided_warp 1.30s, compute_store_aot_mimg_atomic_minmax_warp 1.30s, compute_store_aot_mubuf_exchange_warp 1.07s, compute_store_aot_alu_med3_warp 1.05s, pixel_aot_attribute_warp 0.67s, pixel_aot_get_lod_warp 1.26s, compute_store_aot_descriptor_store_format_warp 1.45s, compute_store_aot_add_co_warp 1.04s, compute_store_aot_gfx1013_image_store_d16_warp 0.68s, compute_store_aot_bfe_warp 1.03s, compute_store_aot_vadd_nc_i32_warp 1.06s, compute_store_aot_gfx1013_image_atomics_warp 1.41s, compute_store_aot_ff1_scalar_warp 1.06s, startup_gfx2hlsl_mad_dispatch_warp 1.17s, startup_gfx2hlsl_dpp_quad_swap_hardware 1.47s, pixel_aot_dmask_warp 1.10s, pixel_aot_dpp_f16_warp 3.30s, compute_store_aot_mubuf_vector_warp 1.19s, pixel_aot_u32_from_f32_warp 0.89s, compute_store_aot_readlane_warp 0.94s, compute_store_aot_mubuf_counter_warp 1.01s, compute_store_aot_ds_route_warp 0.99s, startup_gfx2hlsl_interp_f16_hardware 0.64s, compute_store_aot_writelane_warp 1.07s, compute_store_aot_mimg_atomic_exchange_warp 0.97s, compute_store_aot_dpp_warp 0.86s, compute_store_aot_sub_co_warp 1.03s, compute_store_aot_mubuf_store_format_xyz_warp 0.88s, compute_store_aot_bcnt_exec_warp 0.98s, compute_store_aot_mubuf_counter-x2_warp 1.04s, compute_store_aot_mubuf_csub_warp 0.96s, compute_store_aot_ff1_exec_warp 0.96s, compute_store_aot_salu_i32_warp 1.14s, pixel_aot_shift64_warp 2.92s, compute_store_aot_alu_lane_gaps_warp 1.25s, pixel_aot_f16_fmac_ldexp_warp 2.82s, startup_gfx2hlsl_dpp_quad_swap_warp 1.43s, pixel_aot_uncompressed_integer_export_warp 1.13s, startup_gfx2hlsl_dpp_pair_warp 1.41s, pixel_aot_cmp64_warp 2.32s, pixel_aot_cvt_f64_int_warp 2.37s, pixel_aot_compressed_export_warp 0.97s, startup_gfx2hlsl_vopc_sdwa_hardware 0.93s, pixel_aot_dpp_movrel_warp 1.26s, pixel_aot_vop3_ternary_int_warp 1.43s, pixel_aot_plain_movrel_warp 1.54s, pixel_aot_f16_cvt_int16_warp 2.05s, pixel_aot_int16_ternary_warp 2.18s, startup_gfx2hlsl_f32_sdwa 1.91s, compute_store_aot_mac_f32_warp 1.03s, startup_gfx2hlsl_scalar_m0_warp 0.84s, compute_store_aot_dot_u_warp 1.01s, pixel_aot_rndne_warp 1.07s, pixel_aot_cvt_float_int_e64_warp 1.73s, pixel_aot_pk_fmac_warp 1.67s, pixel_aot_swaprel_warp 1.04s, pixel_aot_scc_skip_warp 1.59s, startup_gfx2hlsl_watch 2.33s, pixel_aot_cvt_f32_f64_warp 1.52s, pixel_aot_region_scalar_load_warp 1.40s, compute_store_aot_vcmp_select_warp 1.96s, pixel_aot_uncompressed_export_warp 1.13s, pixel_aot_sdwa_integer_warp 1.18s, startup_gfx2hlsl_mad_preserve_warp 0.74s, pixel_aot_ds_swizzle_warp 0.92s, pixel_aot_int16_vop3_warp 1.49s, startup_gfx2hlsl_vopc_sdwa_warp 0.96s, startup_gfx2hlsl_compute_hardware 1.11s, pixel_aot_f16_to_int16_warp 1.61s, pixel_aot_bitset64_warp 1.56s, startup_gfx2hlsl_dpp_quad_broadcast_hardware 0.68s, pixel_aot_div_fmas_warp 1.33s, pixel_aot_region_scalar_alu_warp 1.09s, pixel_aot_sad_warp 1.14s, startup_gfx2hlsl_compute_warp 1.10s, pixel_aot_carry_in_warp 1.16s, startup_gfx2hlsl_cvt_pk_u8_hardware 0.58s, pixel_aot_brev_warp 1.16s, pixel_aot_mad64_warp 1.23s, pixel_aot_align_warp 1.41s, pixel_aot_flat_scratch_warp 1.32s, pixel_aot_frexp_exp_warp 1.07s, pixel_aot_plain_bitscan_warp 1.34s, pixel_aot_first_bit_warp 1.31s, pixel_aot_swap_warp 1.10s, startup_gfx2hlsl_f32_lg 1.11s, pixel_aot_sdwa_unary_warp 1.10s, pixel_aot_smovrel_warp 1.14s, startup_gfx2hlsl_dpp_quad_broadcast_warp 0.71s, pixel_aot_sdwa_movrel_warp 1.23s, pixel_aot_mac_legacy_warp 1.23s, pixel_aot_sdwa_cmp_warp 1.15s, pixel_aot_e64_spellings_warp 1.25s, pixel_aot_s_call_warp 1.22s, pixel_aot_e64_integer_warp 1.23s, startup_gfx2hlsl_cmp16_warp 1.84s, pixel_aot_carry_out_warp 1.30s, pixel_aot_smem_pointers_warp 1.05s, pixel_aot_title_loads_warp 1.13s, compute_store_aot_gfx1013_gather4_l_warp 1.31s, startup_gfx2hlsl_compute_dropped-store_hardware 0.25s, pixel_aot_bfm_warp 1.09s, startup_gfx2hlsl_capture 0.93s, pixel_aot_pack_b32_warp 1.17s, startup_gfx2hlsl_compute_swapped-axes_hardware 0.24s, pixel_aot_integer_nc_warp 1.16s, startup_gfx2hlsl_cvt_pk_u8_warp 0.65s, pixel_aot_e64_approx_warp 1.05s, startup_gfx2hlsl_compute_b-offset_hardware 0.25s, pixel_aot_pack_int16_warp 1.11s, pixel_aot_vop1_nops_warp 1.02s, startup_gfx2hlsl_compute_c-unpredicated_hardware 0.25s, pixel_aot_sopp_round_mode_warp 1.01s, pixel_aot_sopk_hwreg_warp 1.02s, startup_gfx2hlsl_interp_f16_warp 0.76s, startup_gfx2hlsl_sgpr_spill_warp 0.84s, startup_gfx2hlsl_root 0.77s, startup_gfx2hlsl_compute_mbcnt_warp 0.88s, startup_gfx2hlsl_compute_dropped-store_warp 0.30s, startup_gfx2hlsl_compute_swapped-axes_warp 0.28s, startup_gfx2hlsl_compute_c-unpredicated_warp 1.10s, startup_gfx2hlsl_bit_alu_controls 1.33s, startup_gfx2hlsl_compute_b-offset_warp 1.32s, startup_gfx2hlsl_sopk_accum 2.04s, startup_gfx2hlsl_compute_controls 1.11s, pixel_aot_attribute_sampled_warp 5.25s, startup_gfx2hlsl_frexp_cvt 1.70s, compute_store_aot_gfx1013_image_uav_load_warp 2.66s, startup_gfx2hlsl_sample_c_lz_mip 0.40s, startup_gfx2hlsl_sdwa 0.40s, startup_gfx2hlsl_sdwa_cvt 0.95s, startup_gfx2hlsl_refusals 1.19s, startup_gfx2hlsl_swap 0.47s, startup_gfx2hlsl_join_symbols_warp 0.48s, startup_gfx2hlsl_mad_controls 0.17s, startup_gfx2hlsl_shift64_controls 0.16s, startup_gfx2hlsl_interp_f16_controls 0.27s, startup_gfx2hlsl_vcvt_omod 0.12s, startup_gfx2hlsl_tbuffer_16f 0.11s, startup_gfx2hlsl_cndmask_neg 0.12s, startup_gfx2hlsl_operand_count 0.24s, startup_gfx2hlsl_sopk_signext 0.16s, startup_gfx2hlsl_compute_h-inner-unpredicated_warp 0.37s, startup_gfx2hlsl_compute_f-broadcast_warp 0.35s, startup_gfx2hlsl_dpp_quad_broadcast 0.14s, startup_gfx2hlsl_compute_f-peer_warp 0.29s, startup_gfx2hlsl_b64_shift 0.11s, startup_gfx2hlsl_opsel 0.11s, startup_gfx2hlsl_export_mask 0.16s, startup_gfx2hlsl_compute_g-swapped-offsets_warp 0.29s, startup_gfx2hlsl_frexp_cvt_controls 0.16s, startup_gfx2hlsl_export_mask_drop_control 0.16s, startup_gfx2hlsl_compute_j-scalar-dropped_warp 0.29s, startup_gfx2hlsl_cvt_alu_controls 0.17s, startup_gfx2hlsl_scalar_m0_controls 0.12s, startup_gfx2hlsl_cmp16_controls 0.29s, startup_gfx2hlsl_compute_g-overlap_warp 0.29s, startup_gfx2hlsl_compute_k-block-entered_warp 0.29s, startup_gfx2hlsl_add_sub_co_controls 0.14s, startup_gfx2hlsl_dpp_quad_swap_controls 0.16s, startup_gfx2hlsl_dpp_pair 0.14s, startup_gfx2hlsl_readfirstlane_recompute 0.14s, startup_gfx2hlsl_cvt_pk_u8_controls 0.12s, startup_gfx2hlsl_join_symbols_controls 0.25s, startup_gfx2hlsl_readfirstlane_uniform 0.14s, startup_gfx2hlsl_s_sext_cmov 0.13s, startup_gfx2hlsl_handler_arity 0.12s, startup_gfx2hlsl_smem_offset 0.12s, startup_gfx2hlsl_int_med3_controls 0.15s, startup_gfx2hlsl_s_bitcmp 0.14s, startup_gfx2hlsl_mask_overwrite_controls 0.13s, startup_gfx2hlsl_cselect_mask_controls 0.11s, startup_gfx2hlsl_scalar_shift64_bfe_controls 0.23s, startup_gfx2hlsl_join_symbols_folded_warp 0.22s, startup_gfx2hlsl_sgpr_spill_controls 0.14s, startup_gfx2hlsl_op_refusals 0.10s, startup_gfx2hlsl_neg_operand 0.12s, startup_gfx2hlsl_calculated_target 0.12s, startup_gfx2hlsl_loop_constants 0.12s, startup_gfx2hlsl_saveexec_same_reg_controls 0.12s, startup_gfx2hlsl_image_get_lod_controls 0.12s, startup_gfx2hlsl_compare_dst_controls 0.10s, startup_gfx2hlsl_scalar_brev_fold 0.12s, startup_gfx2hlsl_image_arity 0.10s, startup_gfx2hlsl_draw_skip 0.43s, startup_gfx2hlsl_sgpr_spill_hardware 0.76s, startup_gfx2hlsl_cmp16_hardware 1.53s, startup_gfx2hlsl_compute_mbcnt_hardware 0.57s, startup_gfx2hlsl_compute_f-peer_hardware 0.24s, startup_gfx2hlsl_compute_f-broadcast_hardware 0.24s, startup_gfx2hlsl_compute_g-swapped-offsets_hardware 0.25s, startup_gfx2hlsl_compute_g-overlap_hardware 0.24s, startup_gfx2hlsl_compute_j-scalar-dropped_hardware 0.23s, startup_gfx2hlsl_compute_h-inner-unpredicated_hardware 0.24s, startup_gfx2hlsl_compute_k-block-entered_hardware 0.25s, startup_gfx2hlsl_join_symbols_folded_hardware 0.18s, startup_gfx2hlsl_join_symbols_hardware 0.32s)
  • sccache: 379/1903 hits; wall 1704.8s

AI-assisted; commands listed were executed locally.

@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Win2025 WARP receipt for head d933b81 after updating with main.

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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim -- -j 2): 0.44s (configure 0.00s)
    • Test (ctest --preset dev -R 'startup_gfx2hlsl_frexp_cvt' --parallel 2 --no-tests=error --output-on-failure): 4/4 passed (18.23s: startup_gfx2hlsl_frexp_cvt_warp 17.07s, startup_gfx2hlsl_frexp_cvt_hardware 17.09s, startup_gfx2hlsl_frexp_cvt_controls 0.20s, startup_gfx2hlsl_frexp_cvt 0.93s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim -- -j 2): 18.25s (configure 0.00s)
    • Test (ctest --preset release -R 'startup_gfx2hlsl_frexp_cvt' --parallel 2 --no-tests=error --output-on-failure): 4/4 passed (11.82s: startup_gfx2hlsl_frexp_cvt_warp 11.04s, startup_gfx2hlsl_frexp_cvt_hardware 11.04s, startup_gfx2hlsl_frexp_cvt_controls 0.14s, startup_gfx2hlsl_frexp_cvt 0.57s)
  • Windows Python checks: tests/mesh_heap_sampler_check.py ok (0.9s), tests/startup_buffer_address_check.py ok (0.8s), tests/startup_compute_request_offline_check.py ok (1.4s), tests/startup_compute_translate_check.py ok (1.4s), tests/startup_flat_param_check.py ok (0.3s), tests/startup_gfx2hlsl_add_sub_co_check.py ok (0.2s), tests/startup_gfx2hlsl_bit_alu_check.py ok (1.3s), tests/startup_gfx2hlsl_capture_check.py ok (1.6s), tests/startup_gfx2hlsl_cmp16_check.py ok (0.5s), tests/startup_gfx2hlsl_compare_dst_check.py ok (0.2s), tests/startup_gfx2hlsl_compute_check.py ok (0.6s), tests/startup_gfx2hlsl_cselect_mask_check.py ok (0.2s), tests/startup_gfx2hlsl_cvt_alu_check.py ok (0.3s), tests/startup_gfx2hlsl_f32_lg_check.py ok (2.5s), tests/startup_gfx2hlsl_f32_nan_check.py ok (9.7s), tests/startup_gfx2hlsl_handler_arity_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.2s), tests/startup_gfx2hlsl_join_symbols_check.py ok (0.3s), tests/startup_gfx2hlsl_loop_constants_check.py ok (0.1s), tests/startup_gfx2hlsl_mask_overwrite_check.py ok (0.1s), tests/startup_gfx2hlsl_operand_count_check.py ok (0.3s), tests/startup_gfx2hlsl_readfirstlane_recompute_check.py ok (0.2s), tests/startup_gfx2hlsl_readfirstlane_uniform_check.py ok (0.2s), tests/startup_gfx2hlsl_refusals_check.py ok (0.7s), tests/startup_gfx2hlsl_root_check.py ok (0.9s), tests/startup_gfx2hlsl_saveexec_same_reg_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_brev_fold_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_m0_check.py ok (0.1s), tests/startup_gfx2hlsl_sdwa_cvt_check.py ok (0.5s), tests/startup_gfx2hlsl_sgpr_spill_check.py ok (0.2s), tests/startup_gfx2hlsl_shift64_check.py ok (0.2s), tests/startup_gfx2hlsl_smem_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_sop2_complement_check.py ok (7.6s), tests/startup_gfx2hlsl_sopk_accum_check.py ok (1.5s), tests/startup_gfx2hlsl_sopk_signext_check.py ok (0.2s), tests/startup_gfx2hlsl_swap_check.py ok (0.4s), tests/startup_gfx2hlsl_vopc_sdwa_check.py ok (8.1s), tests/startup_gfx2hlsl_watch_check.py ok (2.9s), tests/startup_image_2d_array_check.py ok (1.0s), tests/startup_image_3d_check.py ok (0.7s), tests/startup_image_gather_lz_check.py ok (1.3s), 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 (0.2s), tests/startup_inline_sampler_check.py ok (0.3s), tests/startup_run_ps1_check.py ok (15.6s), tests/startup_run_sh_check.py FAIL (0.1s), tests/startup_sampler_heap_check.py ok (0.1s), tests/startup_smem_address_check.py ok (0.2s), 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: 0/-4 hits; wall 124.4s

AI-assisted; commands listed were executed locally.

@thepatrickworld

Copy link
Copy Markdown
Contributor

Full receipt on this head, on an AMD desktop adapter — the complement to the WARP run above.

Machine: Windows 11, AMD Radeon RX 9070 XT (1002:7550), driver 32.0.32029.2010, DXC and fxc from the 26100 SDK, commit 5ea89c2a.

Both presets, same filter as above (^(startup_gfx2hlsl_.*|pixel_aot_.*_warp|compute_store_aot_.*_warp|form_coverage)$, --parallel 2 --no-tests=error):

  • dev: 298 selected, 298 passed, 0 skipped, 517.90s
  • release: 298 selected, 298 passed, 0 skipped, 375.98s

What that 298 is made of: 34 tests with a hardware stage, 200 _warp tests (software rasterizer), and 64 translator/format tests with no GPU. Only the 34 touch an adapter, so "298 tests on AMD" would be the wrong sentence; "298 tests, 34 of them on the card" is the right one.

Why the 34 ran, and were not skipped. A ctest summary cannot show this: CTest counts a skipped test as passed (cmCTestRunTest::EndTestResult::Passed = passed || skipped, cmCTestRunTest.cxx:385), so a machine with no GPU prints the same "100% tests passed" line. Three other checks, on the same tree:

  • I ran every _hardware test in the tree with -V (488 selected: 13 skipped, 9 failed, the rest passed). Of the 34 hardware tests in this PR's filter, 31 print adapter=AMD Radeon RX 9070 XT vendor=1002 device=7550; the other three (dpp_quad_swap, sgpr_spill, scalar_m0) print no device line at all, so for those the evidence is the test result and the absence of a skip, not an adapter name.
  • Across the whole 488, an adapter line is not a guarantee of the physical card: 279 tests name the RX 9070 XT only, 23 name it and Microsoft Basic Render Driver as well, and 2 (#878, #1169) create their device only on the basic render driver.
  • Negative control: with XBOX2WINDOWS_ADAPTER=aucune-carte-de-ce-nom the test does not skip — it fails with No D3D12 hardware adapter matches XBOX2WINDOWS_ADAPTER=.... With the correct name the same test passes and prints the adapter line.

So on this machine the 34 hardware tests of the filter ran on the adapter, and the 200 _warp tests ran on the software rasterizer.

Out of scope, for a separate report: the sweep also reproduces the three failures already recorded in #1148 (dxr_opacity_hardware, gpu_alias_lookup_writes_hardware, pixel_aot_comparisons_hardware), five tests that exit 0xc0000409 (startup_indirect_translated_indexed_hardware plus its upload, rect and alias variants, and startup_indirect_rectlist_hardware), and one assertion failure in compute_store_aot_mac_f32_hardware. None of them are in this PR's filter.

AI-assisted.

@thepatrickworld

Copy link
Copy Markdown
Contributor

One correction to the line above: the head moved while I was measuring. Everything in that receipt is for 5ea89c2a; the branch is now at d933b81e, a merge of main (24 commits, including #1747 and #2059). I am re-running both presets on d933b81e and will post the numbers there rather than let the two be confused.

AI-assisted.

@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

@thepatrickworld thank you for the AMD run and for the clear split between the 34 adapter tests and the WARP and translator ones. That is the number we needed from real hardware.

The 5ea89c2a and d933b81e heads differ only by the merge of main, so your result carries over to this change. The dev and release WARP receipt for d933b81e is in the comment above. A rerun on d933b81e is welcome but not required.

The PR is still waiting on the choice against #1918 (both touch v_ldexp).

AI-assisted; commands listed were executed locally.

@thepatrickworld

Copy link
Copy Markdown
Contributor

Both numbers, so the two heads are not confused.

5ea89c2a, second run (same filter, same machine): 298/298 in dev (509.71s) and 298/298 in release (378.09s), 0 skipped. That brackets the first run (517.90s / 375.98s), so the result is stable between runs.

d933b81e, the current head (a merge of main, 24 commits): the same filter now selects 302 tests — 35 with a hardware stage, 201 _warp, 66 translator/format — and 302/302 pass in both presets, 0 skipped: dev 522.86s, release 379.35s.

One limit on the new head: the adapter-level evidence I posted above (31 of the 34 hardware tests printing adapter=AMD Radeon RX 9070 XT vendor=1002 device=7550, plus the negative control) was collected on the 5ea89c2a tree with ctest -V. For d933b81e I have the pass counts and the absence of skips, not a fresh per-test adapter trace — say the word and I will run the -V sweep on it too.

AI-assisted.

@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

@thepatrickworld thank you, that settles it. 302/302 in both presets on d933b81e, with stable times against the two 5ea89c2a runs, is what we needed. The -V adapter sweep on the new head is not required: the change between the heads is only the merge of main, and the pass counts with zero skips cover it.

The PR still waits on the choice against #1918 (both touch v_ldexp).

AI-assisted; commands listed were executed locally.

legacy-code-archaeologist added a commit to legacy-code-archaeologist/Xbox2Windows that referenced this pull request Nov 25, 2026
@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this PR for now so we can focus on the test-speed work. The branch stays as it is, and review comments here remain valid.

We will reopen it later, bring it up to date with main, 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
@tedin7
tedin7 marked this pull request as draft November 26, 2026 05:25
@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

Reopened: brought up to date with current main by merge (no rebase, no force push). Three conflicts: CMakeLists.txt and docs/experiments.md kept both sides, tools/startup/gfx2hlsl.py kept both handler groups. The three earlier review threads were answered in the previous round (exact cvt_rpi rounding, sign-dependent NaN saturation, startup docs); their fixes are all in this head. startup_gfx2hlsl_frexp_cvt_check.py passes on the merged head. Win2025 WARP and the independent review are next; this stays a Draft until then.

AI-assisted; commands listed were executed locally.

@tedin7

tedin7 commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Independent review (not the author) at 628685facc84346ee2ab5c2cd97bc5e73bb6a424: no blocking finding.

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

  • Debug (--preset dev): cmake --build --preset dev --target offscreen_check, then ctest --preset dev -R '^startup_gfx2hlsl_frexp_cvt(_controls|_warp)?$' --no-tests=error --output-on-failure: 3/3 passed (startup_gfx2hlsl_frexp_cvt_controls 0.19s, startup_gfx2hlsl_frexp_cvt 0.54s, startup_gfx2hlsl_frexp_cvt_warp 9.77s).
  • Release (--preset release): the same two commands: 3/3 passed (startup_gfx2hlsl_frexp_cvt_controls 0.17s, startup_gfx2hlsl_frexp_cvt 0.49s, startup_gfx2hlsl_frexp_cvt_warp 8.16s).
  • startup_gfx2hlsl_frexp_cvt_hardware was not run (WARP only).
  • Windows Python checks of the default plan: all ok (tests/startup_run_ps1_check.py failed once under parallel load on the first try and passed on the rerun, unrelated to this change).

Linux:

  • Every tests/startup_*check.py run on this head and on origin/main (merged): the only scripts whose result differs are the two new ones, and both pass.
  • python3 -B tests/startup_gfx2hlsl_frexp_cvt_check.py with 20000 extra random and boundary words for each of the four unary operations and 20000 v_ldexp_f32 pairs (denormals, infinities, NaNs, -0, k + 0.5 and its one-ulp neighbours, the +-300 clamp, 2^31 shifts), using the test's own evaluator and references: 0 mismatches.
  • Six one-line mutations of the lowering (exponent bias, cvt_rpi threshold, frexp sign mask, NaN word, ldexp clamp, flr clamp) are each caught by the check.
  • Operand forms: the integer-result forms refuse clamp, omod, SDWA and DPP; the float-result forms take neg, abs, clamp, mul and div, inline constants, literals and SGPR sources.
  • Three existing compute shapes that this change newly lowers (v_ldexp_f32 with a variable, a constant and a wave64 compare) read back on WARP equal to their CPU references.

Note, not blocking: denormal inputs and results follow the flush-to-zero convention the translator already uses; the hardware denormal mode is not modelled (the PR states this).

AI-assisted; commands listed were executed locally.

@tedin7
tedin7 marked this pull request as ready for review November 26, 2026 05:38

@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: 628685facc

ℹ️ 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".

@thepatrickworld

Copy link
Copy Markdown
Contributor

Denormal inputs on 628685facc: the fixture's references are not uniformly flush-to-zero. Measurements only; not a code change.

Environment

Windows 11 25H2, build 26200.9974. adapter=AMD Radeon RX 9070 XT vendor=1002 device=7550, driver=32.0.32029.2010, backend=hardware, debug_layer=unavailable; the same inputs were also run on warp. DXC from the kit in DXC_EXECUTABLE (no STARTUP_FXC), head 628685facc84346ee2ab5c2cd97bc5e73bb6a424 in a clean worktree at --preset dev.

What I ran

The docstring excludes denormal inputs and results, so I ran the five operations with them, through the fixture's own pipeline and its references (tests/startup_gfx2hlsl_frexp_cvt_check.py:170 for ref_frexp_mant, :192 for ref_cvt_flr, :201 for ref_ldexp). The probe is local, not part of this branch: 14 chunks of four lanes, twelve denormal words for the unary operations and eight denormal-result pairs for v_ldexp_f32. Three chunks mismatch, identically on this adapter and on WARP:

startup_flat_param mismatch expected=ffffffff,ffffffff,ffffffff,ffffffff actual=00000000,00000000,00000000,00000000
startup_flat_param mismatch expected=00400000,00200000,00200000,00000001 actual=00000000,00000000,00000000,00000000
startup_flat_param mismatch expected=80000001,00000004,00800000,00000200 actual=80000000,00000000,00800000,00000000

First line: v_cvt_flr_i32_f32 on four negative denormals. The other two: v_ldexp_f32 on denormal results, where the normal control (0x00800000) survives and only the denormal words flush, sign kept.

Why it is worth a line

The two conventions are mixed inside the references, not only between the hardware and the model. ref_frexp_mant already answers a denormal with a signed zero, but ref_cvt_flr(0x80000001) is 0xffffffff and ref_ldexp(0x00800000, -2) is 0x00200000 — exact, not flushed. So the flush-to-zero convention the note above describes holds for the emitted code, not for the references: a denormal row added to the fixture as it stands would fail on both backends. Is the intended model flush-to-zero everywhere (then ref_cvt_flr and ref_ldexp should model the flush), or exact (then the lowering needs the denormal handling)? v_frexp_mant_f32 and v_frexp_exp_i32_f32 read the reference value on both backends. v_cvt_rpi_i32_f32 also matches, but its reference is zero for these inputs either way, so that row does not separate the two models.

Limits

The comparison is the emitted HLSL on a desktop pipeline against the Python references, not the console ISA. One adapter, one driver, no debug layer, one compiler. The probe is not part of this branch and is not proposed as one.

AI-assisted.

@R0Y00

R0Y00 commented Nov 26, 2026

Copy link
Copy Markdown
Owner

I resolved the CMake clash in eda3d9d and tightened the mutation check to require a pixel readback mismatch. FXC and DXC pass the selected draw cases and catch each mutation on WARP and RTX 4060 Laptop with zero debug errors or warnings.

The RX 9070 XT report shows what the desktop path did for the extra denormal rows. Please keep those results separate from a guest guarantee. For the FLR and LDEXP cases that distinguish flushing from preservation, a focused source-built native reference needs to identify the selected floating-point mode and record the input and output words. Keep the current normal-domain oracle intact and describe any supported guest profile at the point where it is selected.

@thepatrickworld

Copy link
Copy Markdown
Contributor

MODE[5:4], the binary32 denormal mode, is a program selection the startup translator accepts and does not model on eda3d9d9; the pixel path refuses the same write. Measurements and code facts; not a code change.

What I ran

Head eda3d9d9, clean worktree, pure Python, no GPU or compiler. The encoded s_setreg_imm32_b32 words through the real path (decode(), check_encoding(), Stage(..., refusals=[])) and through the unit entry lowered() uses; and pixel_aot.translate on the witness body of tests/pixel_aot_check.py. Neither probe is part of this branch.

Observed

startup gfx2hlsl, s_setreg_imm32_b32 on HW_REG_MODE
(HW_REG_MODE, 4, 2), 3        OK, no line emitted
(HW_REG_MODE, 6, 2), 3        OK, no line emitted
(HW_REG_MODE, 0, 32), 0x30    OK, no line emitted
(HW_REG_MODE, 0, 2), 3        REFUS writes the binary32 rounding mode MODE[1:0]
pixel_aot, the same writes
(HW_REG_MODE, 4, 2), 3        REFUS Unsupported hardware register write: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 2), 3
(HW_REG_MODE, 2, 2), 3        write accepted; the body is then refused on its binary16 op

The lowered v_ldexp_f32 line is byte-identical with and without an accepted FP_DENORM = 3 write in front of it, and the handler is the same on main (da2a8f6f, gfx2hlsl.py:3988), so the branch does not introduce the acceptance.

Why it bears on this fixture

MODE[5:4] is the binary32 denormal field, 0 flush both and 3 allow both; this repository already names it that way in the v_cvt_f64_f32 entry of docs/experiments.md. ref_cvt_flr and ref_ldexp compute the exact value (the docstring says ldexp denormal results are not covered, but ref_ldexp computes them exactly), while the emitted HLSL produced flushed words on WARP and on the RX 9070 XT; op_v_ldexp_f32 and op_v_cvt_flr_i32_f32 are unchanged between 628685fa and eda3d9d9, so those words carry over.

With the selection untracked, two programs that select different modes translate to the same HLSL, so one reference cannot be right for both. The pixel path has both mechanisms on the adjacent field: it declares the MODE[7:6] entry state (pixel_aot.py:692, refused by :3609 when undeclared) and refuses every MODE write outside the rounding field; the binary32 field is not declared there, that write is refused.

Also worth pinning: this draw compiles the pair at ps_6_0 (tests/startup_gfx2hlsl_frexp_cvt_warp_check.py:140), where -denorm is unavailable (SM 6.2 minimum), while the pixel draws request a mode at ps_6_2 (tests/pixel_aot_check.py:361) — the desktop run could not select one.

This is not the source-built native reference you asked for; it only locates where the mode selection lands in this branch, and the normal-domain oracle is not in question. Whether the startup path declares the binary32 entry state or refuses the write that selects an unmodelled mode is a call for the branch; either way the profile this fixture assumes needs a place to be stated, as you asked.

Limits

No console hardware and no GPU in this run; the desktop words are the earlier ones, one adapter, one driver. The probes are not ctest entries and are not proposed as one.

AI-assisted.

@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

Thank you, all three comments are answered below.

  • Readback-mismatch review thread: already fixed in eda3d9d9 (a mutation now counts only when the pixel readback differs, not when PSO creation or the debug layer fails). Resolving the thread.
  • Denormal measurements and the MODE[5:4] note: agreed, and kept separate from a guest guarantee. The normal-domain oracle is unchanged. The docstring of tests/startup_gfx2hlsl_frexp_cvt_check.py now states the profile at the point it matters: normal inputs and results, zero, inf and NaN only; the binary32 denormal selection is not modelled (the translator accepts that write and emits no line for it, as on main); the denormal rows of ref_cvt_flr, ref_ldexp and ref_frexp_mant are not a guest guarantee, and a desktop result on them says nothing about the console.
  • A guest denormal profile needs a source-built native reference that records the selected mode, the input words and the output words. That is a separate change; I have not started it here and will not describe denormal behaviour as supported until it exists.

Verification: python3 -B tests/startup_gfx2hlsl_frexp_cvt_check.py passes on the new head. The change is a docstring only.

AI-assisted; commands listed were executed locally.

@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

Withdrawn: shader translation is moving to the native C++ frontend (see #870), so we are not continuing this change to the Python translator. The branch stays available if any part is useful later. Thank you to everyone who reviewed and tested it.

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.

4 participants