Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
c99d412 to
7f43681
Compare
|
Independent run on hardware. 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 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. |
9cbf365 to
3bf27cb
Compare
|
Failure (Windows x64, Python 3.12.0, 3.12.10 and 3.11.17) Command, from the repository root: 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 rResult 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:
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 ( |
|
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$' -VEnvironment: NVIDIA GeForce RTX 3070 Ti ( Observed Every Pixel 4 takes FXC and DXC read the same words. I ran the draw check again without the DXC stops at the same place with the same actual words:
Lowering involved ( expr = '((%s * exp2(float(%s))) * exp2(float(%s))) * exp2(float(%s))' % (self.f(ops[1]), a, b, c)where Limits
I do not propose a fix here. |
|
Thanks @Makto94, the analysis was exact. Head Verified on Windows Server 2025 (D3D12 WARP) at
This reply covers only your first report (the CPU check). Your RTX 3070 Ti report on AI-assisted; commands listed were executed locally. |
|
Re-tested the new head CPU: WARP and controls ( Hardware: All 148 |
|
Correction to my earlier comment: 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.
…owerings in gfx2hlsl
…the shader compiler keeps
…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.
5e3ca3e to
4807377
Compare
|
RTX 3070 Ti run on head Hardware: No Environment: NVIDIA GeForce RTX 3070 Ti ( |
|
Thank you @Makto94 for the RTX 3070 Ti run at AI-assisted; commands listed were executed locally. |
|
Head Five operations — That line is the interesting one for AI-assisted. |
|
Thank you @thepatrickworld for the AMD Radeon RX 9070 XT run ( You ran head 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. |
|
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
AI-assisted; commands listed were executed locally. |
|
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
AI-assisted; commands listed were executed locally. |
|
Full receipt on this head, on an AMD desktop adapter — the complement to the WARP run above. Machine: Windows 11, Both presets, same filter as above (
What that 298 is made of: 34 tests with a hardware stage, 200 Why the 34 ran, and were not skipped. A
So on this machine the 34 hardware tests of the filter ran on the adapter, and the 200 Out of scope, for a separate report: the sweep also reproduces the three failures already recorded in #1148 ( AI-assisted. |
|
One correction to the line above: the head moved while I was measuring. Everything in that receipt is for AI-assisted. |
|
@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 The PR is still waiting on the choice against #1918 (both touch AI-assisted; commands listed were executed locally. |
|
Both numbers, so the two heads are not confused.
One limit on the new head: the adapter-level evidence I posted above (31 of the 34 hardware tests printing AI-assisted. |
|
@thepatrickworld thank you, that settles it. 302/302 in both presets on The PR still waits on the choice against #1918 (both touch AI-assisted; commands listed were executed locally. |
|
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 AI-assisted; commands listed were executed locally. |
|
Reopened: brought up to date with current AI-assisted; commands listed were executed locally. |
|
Independent review (not the author) at Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
Linux:
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. |
There was a problem hiding this comment.
💡 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".
|
Denormal inputs on EnvironmentWindows 11 25H2, build 26200.9974. What I ranThe docstring excludes denormal inputs and results, so I ran the five operations with them, through the fixture's own pipeline and its references ( First line: Why it is worth a lineThe two conventions are mixed inside the references, not only between the hardware and the model. LimitsThe 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. |
|
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. |
|
What I ranHead ObservedThe lowered Why it bears on this fixtureMODE[5:4] is the binary32 denormal field, 0 flush both and 3 allow both; this repository already names it that way in the 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 ( Also worth pinning: this draw compiles the pair at ps_6_0 ( 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. LimitsNo 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. |
|
Thank you, all three comments are answered below.
Verification: AI-assisted; commands listed were executed locally. |
|
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. |
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_f32orv_ldexp_f32no longer stopgfx2hlsl.pywith "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,
frexpandldexp.Changes:
tools/startup/gfx2hlsl.py: five new handlers.cvt_rpiisfloor(x + 0.5).ldexpclamps the shift to +-300 and scales in three parts, so no factor overflows binary32.tests/startup_gfx2hlsl_frexp_cvt_check.py: runs the emitted HLSL on the CPU against RDNA 2 ISA references. It is registered asstartup_gfx2hlsl_frexp_cvtinCMakeLists.txt.v_ldexp_f32for 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.pyon 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.gfx2hlsl.pyfromorigin/main: fails withUnsupported: v_frexp_mant_f32.origin/main(three conflicts:CMakeLists.txtanddocs/experiments.mdkept both sides,gfx2hlsl.pykept both handler groups).AI-assisted; commands listed were executed locally.