Repository navigation
Extend C-210 to every bytes float writer - #140
Merged
Merged
Conversation
…or and implement set_float32 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…iters' NaN bits in a fixture Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
Implements the owner's ruling on almide/almide#3658 (2026-10-13): C-210 extends to every bytes float writer.
Contract
C-210 named only the appends (
append_f64_le/be,append_f32_le/be). Its statement now covers the whole family under one rule: the appends, the in-place sets (set_f64_le/be,set_f32_le/be,set_float32) and the cursor writes (write_f64_be,write_float32). Each writes the canonical NaN on every leg: f640x7FF8000000000000, f320x7FC00000. The rest of the statement is unchanged.Fixtures
spec/wasm_cross/nan_canonical_bytes_set_write.almd. It sends five values through every set and write writer:0.0/0.0, afrom_bitspayload NaN (sign set, low payload), a negated NaN, an arithmetic NaN, and1.5. The1.5row shows that non-NaN bits stay raw.spec/wasm_cross/nan_canonical_bytes_write.almdnow matches the implementation's copy. The implementation added the #3647 rows (payload, negated and arithmetic NaN through all four appends) and they had not reached the judge.Reference evaluator
ref/wrote raw bits on every float writer, the appends included, so on a payload NaN it disagreed with C-210. Now:write_bytes_fnfor append/set,write_float32,write_f32_le,write_f64_be) take their bits from one helper pair,obs_bits_f64/obs_bits_f32;bytes.set_float32;write_float32accepts aFloat32value. It used to abstain with a type mismatch.On the reference, both NaN fixtures now print the canonical bytes.
Gates (run locally)
All green:
check-contracts,check-contract-provenance,check-als-element-coverage,check-als-style,check-als-validation,check-links,check-gate-verification,selftest-conformance,check-runner-coverage,check-ratchet-separation --stagedcheck-ref-kernel,check-ref-totality: 733 evaluated, 18 abstained, ceiling 18cargo fmt --checkandcargo clippy -D warningsonref/Regenerated:
docs/contracts/README.md,docs/contracts/conformance.md.After this merges, the implementation advances
proofs/als-pin.txt, then lands native and wasm canonicalization on its branchfix-3658-float-writer-nan.