Skip to content

fix: use reduced form in WASM FromMontgomeryForm test#21164

Merged
kashbrti merged 1 commit intomerge-train/barretenbergfrom
claudebox/fix-bb-merge-train-dequeue
Mar 5, 2026
Merged

fix: use reduced form in WASM FromMontgomeryForm test#21164
kashbrti merged 1 commit intomerge-train/barretenbergfrom
claudebox/fix-bb-merge-train-dequeue

Conversation

@AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Mar 5, 2026

The FromMontgomeryForm test in general_field.test.cpp (added by #20936) was comparing raw limbs after from_montgomery_form(), expecting exactly {1, 0, 0, 0}. However, the WASM Montgomery multiplication returns coarse results in [0, 2p), so from_montgomery_form(one()) can return p+1 instead of 1 — both represent the same field element, but the raw limbs differ.

This caused ecc_tests to fail in WASM builds (FieldTest/0.FromMontgomeryForm for BN254 Fq and FieldTest/1.FromMontgomeryForm for BN254 Fr), which dequeued merge-train/barretenberg PR #21084 from the merge queue.

Fix: use from_montgomery_form_reduced() for base fields to ensure full reduction to [0, p) before raw limb comparison. Extension fields already use from_montgomery_form_reduced() internally on their components, so they are unaffected.

ClaudeBox log: http://ci.aztec-labs.com/5f9c459fdf9e2366-1

@AztecBot AztecBot added the claudebox Owned by claudebox. it can push to this PR. label Mar 5, 2026
@kashbrti kashbrti marked this pull request as ready for review March 5, 2026 13:50
@kashbrti kashbrti enabled auto-merge (squash) March 5, 2026 13:50
@kashbrti kashbrti merged commit 4aa96ef into merge-train/barretenberg Mar 5, 2026
25 checks passed
@kashbrti kashbrti deleted the claudebox/fix-bb-merge-train-dequeue branch March 5, 2026 14:02
github-merge-queue bot pushed a commit that referenced this pull request Mar 6, 2026
BEGIN_COMMIT_OVERRIDE
fix: add -g0 to zig presets to eliminate 11GB debug info bloat (#21071)
fix: resolve flaky p2p_client test race condition on ARM64 (#21088)
chore: remove domain iteration macros and address backing memory race
(#20988)
fix: [ECCVM] added domain separation for the multiset equality check.
(#20352)
feat: hybrid CRS hash verification — 8MB chunks, parallel, span-based
(#21113)
chore: unify splitting scalars interface (#20805)
chore: add a unique id to each origin tag (#20924)
chore: Native curve audit (#20936)
chore: Update bootstrap in test vk haven't changed script (#21153)
fix: use reduced form in WASM FromMontgomeryForm test (#21164)
chore: erase ephemeral secrets from memory in schnorr and aes (#21106)
chore: suppress clangd target triple version diagnostic (#21180)
feat: Optimise new claim calculation (#21179)
docs: add Quick Start build instructions to barretenberg README (#20951)
feat: batched chonk verification (#21083)
fix: link libc++ instead of libstdc++ for Rust FFI on Linux (#21203)
fix: [ECCVM] in the transcript table, no-ops force the next accumulator
to be 0. (#20849)
fix: resolve merge-train conflict with next (zig wrapper scripts + -g0)
(#21201)
fix: [ECCVM] rare edge case completeness issue when `z1 == 0` but `z2 !=
0` (#20858)
fix: use actual data extent for CommitmentKey in HypernovaDeciderProver
(#21206)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants