Repository navigation
Float atomic min/max: handle -0.0 and f64 operands - #38
Merged
Merged
Conversation
The translator turns buffer / flat / global atomic fmin / fmax into one integer atomic, chosen by the operand's sign. It tested the sign with asfloat(v) >= 0.0f, which is true for -0.0, so -0.0 took the signed path, where its bits (0x80000000) are the smallest int. On an RX 7900 XTX, global_atomic_fmin on -5.0 with -0.0 stored -0.0, and fmax left -5.0 in place. The choice now compares the bits with +inf's (0x7F800000): the signed path for +0.0 to +inf, the unsigned path for -0.0, negative values and NaNs. Only -0.0 changes path. One helper, float_minmax_mem, replaces the two copies (FLAT / GLOBAL and rmw32). The same helper gives buffer / flat / global_atomic_fmin_x2 / fmax_x2 with InterlockedMin64 / Max64, without a CAS loop like the f32 forms. ISA coverage: 1034 -> 1040 of 1157; FLAT, FLAT_GLBL and MUBUF complete. Tests: gpu_atomic_fmin_fmax_negative_zero (fails before the fix on global and buffer), atomic_fmin_fmax_x2_are_native_64_bit_atomics (HLSL shape, DXC with one and two memory windows), gpu_atomic_fmin_fmax_x2 (all three families on the GPU: 64 lanes racing, the -0.0 cases, GLC). Co-Authored-By: Claude Opus 5.5 <[email protected]>
CalvyPZ
pushed a commit
to CalvyPZ/xcl
that referenced
this pull request
Nov 24, 2026
Add standalone host-driver parity and contract tests for D3D12.X's memory-layout and copy-footprint query hooks (Part of xcl-dev#480): GetResourceAllocationInfo (xcl-dev#25), GetResourceAllocationInfo2 (console xcl-dev#108 vs PC ID3D12Device8 xcl-dev#68), GetCustomHeapProperties (xcl-dev#26), and GetCopyableFootprints (xcl-dev#38). No runtime files outside crates/xcl/tests/ are modified. Full suite (.\scripts\test.ps1) passed 895 passed, 0 failed, 42 ignored (1 GPU test skipped: heap_window_out_of_memory_falls_back_to_the_switch_form). Part of xcl-dev#480 Assisted-by: Antigravity
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.
Summary
-0.0takes the negative-value path.-0.0results and GLC return values.Testing
-0.0operands and f64 min/max across buffer, flat, and global memory.