shader: emit binary32 float literals in graphics HLSL #3570
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3570
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3568"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@tedin7 on GitHub · 2026-11-30 09:10 UTC · original
tedin7:uppr-gfx2hlsl-f32-literals→main· +105 −94 · 17 files · 4 commits · merged 2026-11-30 09:36 UTCProblem
tools/startup/gfx2hlsl.pyemitted unsuffixed floating-point literals (such as1.0,0.0,255.0,0.0625,6.283185307), which DXC/HLSL can treat as double-precision literals or trigger implicit conversion issues in graphics HLSL.tests/startup_gfx2hlsl_f16_alu_check.pyevaluated lowered HLSL expressions in Python without stripping thefsuffix from float literals.Fix
fsuffix to binary32 floating-point literals emitted bytools/startup/gfx2hlsl.py.tests/startup_gfx2hlsl_vcvt_omod_check.py,tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py, andtests/startup_gfx2hlsl_f16_alu_check.py(plustests/checks/python-linux/gfx2hlsl-vcvt-omod.txt) to expect and parse binary32f-suffixed float literals.Verification
python3 -B tests/startup_gfx2hlsl_vcvt_omod_check.py(passed)python3 -B tests/startup_gfx2hlsl_f16_alu_check.py(passed)python3 -B tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py(passed)python3 -B tests/bidi_controls_check.py(passed)python3 -B tests/docs_links_check.py(passed)git diff --check origin/main..HEAD(passed)@chatgpt-codex-connector[bot] on GitHub · 2026-11-30 09:10 UTC · original · edited 2026-11-30 09:24 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
78fe2beℹ️ About Codex in GitHub
Your 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.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-30 09:24 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
78fe2bec9aℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
@ -3015,3 +3015,3 @@if scale != 1.0:factor = ('%d.0' % int(scale)) if scale == int(scale) else ('%g' % scale)expr = '(%s) * %s' % (expr, factor)expr = '(%s) * %sf' % (expr, factor)@chatgpt-codex-connector[bot] on GitHub · 2026-11-30 09:24 UTC · original
The
python-linuxjob in.github/workflows/windows.ymlstill runs several checks that were not adapted to these suffixes. In particular,tests/startup_gfx2hlsl_sdwa_cvt_check.py::eval_emitted_v0sends the generated* 0.5fexpression directly to Pythoneval, raisingSyntaxError: invalid decimal literal;startup_gfx2hlsl_fma_mix_check.pyandstartup_gfx2hlsl_float_transcendental_check.pyalso fail because their golden strings and mutation patterns still require unsuffixed literals. All three checks pass on the parent revision. Update the remaining evaluators and literal-sensitive expectations alongside the emission change so the standard CI regression suite continues to pass.Useful? React with 👍 / 👎.
@ -3015,3 +3015,3 @@if scale != 1.0:factor = ('%d.0' % int(scale)) if scale == int(scale) else ('%g' % scale)expr = '(%s) * %s' % (expr, factor)expr = '(%s) * %sf' % (expr, factor)@tedin7 on GitHub · 2026-11-30 09:30 UTC · original
Fixed in
831b7e612and96c1506ed.