Direct DXIL v_fract_f32 can return 1.0 for tiny negative inputs #3285

Closed
opened 2026-11-28 05:20:52 +00:00 by github-bot · 1 comment
Owner

@⁠wish131400 on GitHub · 2026-11-28 05:15 UTC · original

The direct DXIL frontend's v_fract_f32 lowering still emits only DXIL Frc, so tiny negative inputs can produce exactly 1.0. The earlier Python paths were corrected in #267 and #2010; this report concerns the newly added native direct frontend.

At base 240e0fb9c460f24d51683abe2d4cce2800b136c1, a source-built gfx1013 request gives:

Input Direct frontend readback Existing instruction contract
0xb0800000 (-2^-30) 0x3f800000 (1.0) 0x3f7fffff
0xb1800000 (-2^-28) 0x3f800000 (1.0) 0x3f7fffff
Either input, mul:2 output modifier 0x40000000 (2.0) 0x3fffffff

The synthetic fixture covers eight inputs and four forms (VOP1, VOP3 source negation, clamp and mul:2) across two wave32 groups. The original frontend differs on 384 of 2,064 output/guard words. A finite cap must run before output modifiers, and must use an ordered comparison so NaN remains NaN. No console hardware result is claimed; the expected bound is the project's existing gfx1013 contract.

Environment: Windows 10 build 19045, NVIDIA GeForce RTX 4070 Ti SUPER, driver 32.0.15.7270, DXC 1.9.2609, Agility 1.620.2. D3D12 debug layer disabled for compute readback. The ordinary Windows 10 fixture executable skips for the SM6.6 requirement; the measured test executable was locally linked with the matching Agility version/path exports and existing runtime. No game bytes, SDK sources or redistributables are included in the fixture.

An accompanying focused PR will add tests/native_fract_f32_check.py with compile/negative controls and hardware readback, so the mismatch can be reproduced without game assets.

**@⁠wish131400** on GitHub · 2026-11-28 05:15 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/3283) The direct DXIL frontend's `v_fract_f32` lowering still emits only DXIL `Frc`, so tiny negative inputs can produce exactly 1.0. The earlier Python paths were corrected in #267 and #2010; this report concerns the newly added native direct frontend. At base `240e0fb9c460f24d51683abe2d4cce2800b136c1`, a source-built gfx1013 request gives: | Input | Direct frontend readback | Existing instruction contract | | --- | --- | --- | | `0xb0800000` (-2^-30) | `0x3f800000` (1.0) | `0x3f7fffff` | | `0xb1800000` (-2^-28) | `0x3f800000` (1.0) | `0x3f7fffff` | | Either input, `mul:2` output modifier | `0x40000000` (2.0) | `0x3fffffff` | The synthetic fixture covers eight inputs and four forms (VOP1, VOP3 source negation, clamp and `mul:2`) across two wave32 groups. The original frontend differs on 384 of 2,064 output/guard words. A finite cap must run before output modifiers, and must use an ordered comparison so NaN remains NaN. No console hardware result is claimed; the expected bound is the project's existing gfx1013 contract. Environment: Windows 10 build 19045, NVIDIA GeForce RTX 4070 Ti SUPER, driver 32.0.15.7270, DXC 1.9.2609, Agility 1.620.2. D3D12 debug layer disabled for compute readback. The ordinary Windows 10 fixture executable skips for the SM6.6 requirement; the measured test executable was locally linked with the matching Agility version/path exports and existing runtime. No game bytes, SDK sources or redistributables are included in the fixture. An accompanying focused PR will add `tests/native_fract_f32_check.py` with compile/negative controls and hardware readback, so the mismatch can be reproduced without game assets.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 05:20:53 +00:00
Author
Owner

@⁠wish131400 on GitHub · 2026-11-28 05:18 UTC · original

The source-built regression and focused correction are available in #3287. The PR records the original 384-word mismatch, fixed hardware readback, and the Windows 10/Agility capability boundary.

**@⁠wish131400** on GitHub · 2026-11-28 05:18 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/3283#issuecomment-7234588431) The source-built regression and focused correction are available in #3287. The PR records the original 384-word mismatch, fixed hardware readback, and the Windows 10/Agility capability boundary.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/R0Y00--Xbox2Windows#3285
No description provided.