Repository navigation
shader: preserve the direct fract binary32 upper bound - #3285
Merged
Merged
Conversation
Match the established fract32 bound from the Python translators in the newer direct DXIL lowering. Preserve NaNs and apply the cap before output modifiers. Refs R0Y00#267, R0Y00#2010.
Collaborator
|
I reviewed the diff (not run). I found nothing wrong with the cap itself. Some notes on its form and on the fixture:
AI-assisted. |
R0Y00
approved these changes
Nov 28, 2026
R0Y00
left a comment
Owner
There was a problem hiding this comment.
Independent Release check on 309c50e0: ctest --preset release --no-tests=error -V -R '^native_fract_f32_' passed 2/2 without a capability skip. On Windows 11 build 26200.9974 with the standard fixture executable, SDK DXC 10.0.26100 and RTX 4060 Laptop driver 32.0.16.1656, the physical readback matched 2,048 result words and 16 guards. The ordered comparison preserves NaNs and applies the cap before scaling/clamping. The uncapped and NaN-losing reference controls differ.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The direct DXIL frontend emits
v_fract_f32as an uncapped DXILFrc. For tiny negative inputs such as -2^-30 and -2^-28, the desktop result rounds to 1.0. The project's gfx1013 contract requires the greatest binary32 below 1.0; amul:2output modifier therefore also produces an incorrect 2.0. Fixes #3283. The Python paths already received the corresponding bound in #267 and #2010; this change covers the newer native direct frontend.Apply an ordered upper-bound comparison before output scaling and clamp. NaNs pass through unchanged. Add a source-built request fixture for eight inputs across VOP1, source-negated VOP3, clamp and
mul:2, with two wave32 groups and guard words. The modified frontend is already part of the generated cache revision.Validation at head
309c50e0, rebased ontoaeef65b2:compile_dxilandnative_store_replayrebuilt successfully after the rebase.native_fract_f32_controlspassed; the pre-rebase patch also passednative_f16_alu_ir,native_frexp_f32_controlsandnative_mad32_controls.python -B tests/docs_links_check.py: 142 Markdown files / 661 links passed.git diff --checkpassed.Measured readbacks: Windows 10 build 19045, RTX 4070 Ti SUPER, driver 32.0.15.7270, DXC 1.9.2609, Agility 1.620.2, D3D12 debug layer disabled. The ordinary Windows 10 fixture executable returns capability skip 77 for SM6.6; the measured run locally relinked the same fixture objects with Agility version/path exports and used the existing matching runtime. This is documented in the experiment note; no SDK runtime is added to the repository. No console hardware or full-program result is claimed.
All instruction bytes are constructed by the fixture. No game assets or SDK implementation code are included.