Repository navigation
feat(u4): add checked MSB projection - #24
Conversation
|
Review recommendation: close or replace this version. The lookup-table implementation is dominated by a direct threshold check in the measured 32-nibble configuration. With the same numeric range checks and output order, this fragment takes 440 policy-compiled bytes and combined stack peak 50; directly computing The deterministic input is Reimplement with the simpler comparison if this API is wanted, and retain the table comparison as a negative result. This comparison does not assert dominance for unmeasured batch sizes. September 11 local validation (unchanged PR head): Reviewed commit: |
|
Reworked this PR around the review result: the 16-entry lookup table is replaced with direct range checks plus Measured at 32 nibbles: 446 locking-script bytes, 34-item peak, 350 static non-push opcodes, and 65 witness bytes. The focused tests cover asymmetric values, malformed negative/oversized inputs at each position, the 998-item standalone frontier, preserved main/alt-stack state, and the 997-item rejection. Also added the implementation README metric fixture, knowledge page/catalog entry, comparison row, and scoped negative result. Focused MSB tests, the exact metric fixture, |
29db12e to
9f34a6f
Compare
|
Review of The direct-threshold implementation addresses the earlier dominated-table concern and includes useful ordering/frontier tests. Resolve the module declaration conflict while retaining all current exports, then rerun the focused MSB and metric checks plus KB validation. Current integration conflicts: Validation scope: source/diff and existing CI review; no new full-repository or field-arithmetic test run was requested. |
Resolve the only textual conflict, src/arithmetic/u4/mod.rs, by keeping every module declaration from origin/main (37) plus this PR's `msb` module (38 total). Neither side declares `pub use` re-exports. The catalog, metric fixtures, READMEs, and negative-results index merged without textual conflicts; all 101 main catalog records are unchanged and the PR's arithmetic/u4-msb record is added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The PR's "u4 MSB lookup table is dominated by a direct threshold at n=32" entry used NR-064, which origin/main already assigns to "Data-only signature budgets falsely reject complete spends" (linked from knowledge/tapscript-budget-validation.md). Git merged both headings without a textual conflict, leaving two NR-064 entries. Renumber the u4 MSB entry to its centrally assigned ID, NR-071. No other file references the renamed entry; main's NR-064 and its link are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed in
Validation on the committed head with a clean tree (
No field-arithmetic tests were run. All evidence is local, using the strict tapscript-context executor with the stack limit enforced. Deployment remains This head was subsequently integrated into |
Summary
Add a checked u4 batch primitive that projects each canonical nibble to its most-significant bit using a 16-item lookup table.
The fragment:
Validation
Full-repository tests were intentionally not run.