Repository navigation
feat(u4): add hint-checked symbol histogram - #286
Conversation
Verify 16 prover-supplied symbol counts of a range-checked u4 vector by comparing packed base-(n+1) lane words, instead of sixteen fixed-symbol counting passes. 3,158 script bytes at 64 nibbles versus at least 18,448 for sixteen passes (lower-bound estimate), for 16 hint items; 1,500 random count forgeries rejected in tests. Evidence locally-reproduced; execution unclassified. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38d4abee34
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Review of The returned histogram preserves the original count items; numeric range checks/Horner equality do not make their bytes canonical when The current CI is green; these are contract, boundary, or evidence gaps that those checks do not cover. |
# Conflicts: # knowledge/catalog.json # src/arithmetic/u4/README.md
|
Thanks, @RobinLinus! The histogram contract now makes clear that counts are checked numerically and returned with their original bytes; a permissive-profile regression covers padded counts and both zero aliases. The fixture now pins 32 incremental hint bytes and the 33-byte standalone vector. Focused tests and metrics pass on the merged base; CI is running and the full non-field suite is queued. |
Summary
arithmetic::u4::histogram::u4_nibbles_histogram_hinted(n)(1..=962, peakn+38): witnessx[0..n-1] c[0..15](c[15]on top) returns the 16 symbol counts and consumes the vector. Every nibble is range-checked to 0..=15 and every claimed count to 0..=n; the claimed counts and the vector's own symbols are packed into the same base-(n+1)lane words and must be equal, so all 16 counts are exact. The existing fixed-symbolcountprimitive is untouched.Evidence
u4_nibbles_countpasses alone are at least 18,448 bytes (lower-bound estimate that excludes the vector copies, not a built comparator): 83% less. At 16 nibbles 956 vs 4,256; at 128, 5,988 vs 37,424. Sizes pinned by a test.u4_nibbles_count; every symbol's count forged by +-1..3; weight moved between symbols and between every adjacent pair of lanes; 1,500 random count vectors accepted exactly when equal to the true histogram; out-of-range counts and nibbles at every position; generation bounds; exact stack frontier.locally-reproduced; executionunclassified. No Bitcoin Core validation or deployability claim. Independent of the open composition-check PR; same lane technique, separately implemented.Test plan
CARGO_PROFILE_DEV_OPT_LEVEL=1 CARGO_PROFILE_TEST_OPT_LEVEL=1 cargo test --locked --no-fail-fast -- --skip fields::(all suites pass)python3 tools/kb.py validate🤖 Generated with Claude Code