Repository navigation
chore: first face re-sync since transfer — #1558 underflow fix + full drift - #101
Merged
Merged
Conversation
… drift (sq-ev2hm) [SONNET-4.6] Ports all in-tree drift accumulated since the noir_IEEE754 repo was transferred to sparq-org. The only source drift was sparq PR #1558 (fix(zk/ieee754): f128 mul/div flush deep-underflow to signed zero): - src/ops/kernels.nr: add `saturating_biased_exponent` helper; apply saturating u32 underflow-safe exponent arithmetic in f128 mul, div, and narrow-format mul/div kernels (sq-25mgo fix). - src/lib.nr: add three regression tests — `f128_mul_deep_underflow_returns_signed_zero`, `f128_div_deep_underflow_returns_signed_zero`, `f128_arithmetic_preserves_gradual_underflow_subnormals`. README.md intentionally kept as-is (standalone published-face content is correct; in-tree README has old vendoring provenance text). Nargo 1.0.0-beta.21: 32/32 in-source tests pass (up from 29 at transfer).
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
Full recursive diff between
sparq-org/sparq:zk/ieee754/(canonical in-tree source) and this standalone repo. Only the Noir source files had drift — from sparq PR #1558 "fix(zk/ieee754): f128 mul/div flush deep-underflow to signed zero".Changes ported
src/ops/kernels.nr— addssaturating_biased_exponent(sum: u32, subtrahend: u32) -> u16helper and applies it in three call sites (f128 mul kernel, f128 div kernel, narrow-format mul/div kernels). This replaces unsafeas u16truncating subtraction with a saturating variant that correctly returns zero instead of aborting on a unsigned underflow when the true result is a deep-underflow zero (IEEE 754-2019 §7.5, sq-25mgo).src/lib.nr— adds three regression tests:f128_mul_deep_underflow_returns_signed_zero— verifies sign-correct zero forsmallest_subnormal²and cross-sign variantsf128_div_deep_underflow_returns_signed_zero— verifies sign-correct zero formin_sub / max_finiteand cross-sign variantsf128_arithmetic_preserves_gradual_underflow_subnormals— anti-over-saturation guard: legitimate subnormals must not be flushed to zeroREADME.md— intentionally kept as standalone published-face content (in-tree README has old vendoring provenance text; standalone README is correct).Test plan
nargo test --silence-warnings→ 32/32 in-source tests pass (Nargo 1.0.0-beta.21).nrfiles and this repo after porting