pixel_aot: v_cvt_i32_f64 and v_cvt_u32_f64 on a provable input domain? (scope question) #1492

Closed
opened 2026-11-26 23:11:28 +00:00 by github-bot · 1 comment
Owner

@⁠JB2WIN on GitHub · 2026-11-24 12:52 UTC · original

tools/pixel_aot.py now converts into binary64 (#1363, #1446; scope closed in #1325). This asks about the next slice, conversions out of binary64: v_cvt_i32_f64 and v_cvt_u32_f64, again restricted to a provable input domain.

What the translator would track. It would record where each binary64 pair it lowered came from:

Source of the pair Domain Result
v_cvt_f64_i32 integer, in i32 range v_cvt_i32_f64 returns the original word exactly
v_cvt_f64_u32 integer, in u32 range v_cvt_u32_f64 returns the original word exactly
v_cvt_f64_f32 with known bits (#1446) known value computed at translation time by truncation toward zero, and accepted only if the value is finite and in range

What would be refused:

  • every cross case, for example a v_cvt_f64_u32 pair converted to i32 or a v_cvt_f64_i32 pair converted to u32, because the result depends on saturation;
  • NaN, infinity and out-of-range known values;
  • any pair whose origin is unknown;
  • clamp, omod, modifiers other than LLVM 15's printed forms, DPP and SDWA.

The test would round-trip the endpoint rows from #1363 (INT_MIN, INT_MAX, UINT_MAX, around 2^24) bit for bit. Fractional known values would cover truncation (±1.5, ±0.75 and the largest normal below 2^31). The negative controls would be a cross case, an out-of-range known value and a pair overwritten between the two conversions.

v_cvt_f32_f64 would stay out for now, because it rounds. It could follow later under the same provenance rule. If you'd rather leave out-conversions until the saturation rules are established, tell me.

AI-assisted (Claude Code).

**@⁠JB2WIN** on GitHub · 2026-11-24 12:52 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/1492) `tools/pixel_aot.py` now converts into binary64 (#1363, #1446; scope closed in #1325). This asks about the next slice, conversions *out of* binary64: `v_cvt_i32_f64` and `v_cvt_u32_f64`, again restricted to a provable input domain. **What the translator would track.** It would record where each binary64 pair it lowered came from: | Source of the pair | Domain | Result | |---|---|---| | `v_cvt_f64_i32` | integer, in i32 range | `v_cvt_i32_f64` returns the original word exactly | | `v_cvt_f64_u32` | integer, in u32 range | `v_cvt_u32_f64` returns the original word exactly | | `v_cvt_f64_f32` with known bits (#1446) | known value | computed at translation time by truncation toward zero, and accepted only if the value is finite and in range | **What would be refused:** - every cross case, for example a `v_cvt_f64_u32` pair converted to i32 or a `v_cvt_f64_i32` pair converted to u32, because the result depends on saturation; - NaN, infinity and out-of-range known values; - any pair whose origin is unknown; - `clamp`, `omod`, modifiers other than LLVM 15's printed forms, DPP and SDWA. The test would round-trip the endpoint rows from #1363 (`INT_MIN`, `INT_MAX`, `UINT_MAX`, around 2^24) bit for bit. Fractional known values would cover truncation (±1.5, ±0.75 and the largest normal below 2^31). The negative controls would be a cross case, an out-of-range known value and a pair overwritten between the two conversions. `v_cvt_f32_f64` would stay out for now, because it rounds. It could follow later under the same provenance rule. If you'd rather leave out-conversions until the saturation rules are established, tell me. AI-assisted (Claude Code).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:11:28 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 13:22 UTC · original

The restricted slice can proceed. Track both words of the binary64 pair through copies and control flow. At a join, keep provenance only when every reachable path establishes the same supported domain. Keep the same-signedness round trips and known finite values whose truncated result fits the destination. Add a one-half clobber or divergent join control. Leave cross-signedness, unsupported modifiers, and special or out-of-range values for separately measured behavior.

**@⁠R0Y00** on GitHub · 2026-11-24 13:22 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/1492#issuecomment-7132746219) The restricted slice can proceed. Track both words of the binary64 pair through copies and control flow. At a join, keep provenance only when every reachable path establishes the same supported domain. Keep the same-signedness round trips and known finite values whose truncated result fits the destination. Add a one-half clobber or divergent join control. Leave cross-signedness, unsupported modifiers, and special or out-of-range values for separately measured behavior.
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#1492
No description provided.