Skip to content

pillar: bit-exact i128 lattice signature lane + Hambly-Lyons Thm 5/6 certificate - #292

Merged
AdaWorldAPI merged 2 commits into
masterfrom
claude/adaworld-substrate-harvest-pvfbs9
Sep 2, 2026
Merged

pillar: bit-exact i128 lattice signature lane + Hambly-Lyons Thm 5/6 certificate#292
AdaWorldAPI merged 2 commits into
masterfrom
claude/adaworld-substrate-harvest-pvfbs9

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Sep 1, 2026

Copy link
Copy Markdown
Owner

What

src/hpc/pillar/lattice_signature.rs (feature pillar): the bit-exact integer signature of a lattice walk, and the finite-depth Hambly-Lyons certificate it makes executable in ndarray. Twin of lance-graph jc::hambly_lyons W6 (AdaWorldAPI/lance-graph#1133), with the f64 tolerance replaced by integer equality.

  • For unit-step lattice walks every level-k signature coefficient has denominator k!, so the lane stores k!·S_k as i128. Identity is ==. No f32, no f64, no tolerance anywhere in the kernel.
  • Chen composition with a unit step σ·e_a is a binomial convolution against a tensor supported on (a,…,a) only: (T·E)_k[w] = Σ_{j≤r(w)} C(k,j)·T_{k−j}[w[..k−j]]·σ^j, O(Σ_k d^k·k) per step.
  • Integer depth policy. theorem2_depth(L) = ⌈47917·L/10000⌉ ≥ ⌊2e·ln(1+√2)·L⌋. The constant is the published one: Hambly & Lyons, Annals of Math 171 (2010), Theorem 5 states ⌊2e·log(1+√2)·L⌋ and its proof sets x = 2·log(1+√2)·L. The arXiv math/0507536v2 preprint states Theorem 2 with e — a version trap CodeRabbit caught on the lance-graph twin; corrected here in e1f0e72. theorem3_factor(d) = 2⌈log₃(d/2)⌉+3 by integer loop. The transcendental constant never enters the code.
  • Overflow contract: len^depth < 2^126 (fits_i128), checked arithmetic, never wrapped.
  • prove_pillar_11_lattice() returns a PillarReport (psd_rate = separated fraction, n_paths = reduced words, n_hops = depth-2 false merges, lognorm_concentration = deepest separation level).

Pins (all exact)

arm result
reduced d=2 words of length ≤ 3 at the theorem depth (LATTICE_L_MAX = 3: depth 19 at L=4 already allocates 2^19 coefficients per level) 52/52 separated
tree-like words (random c c⁻¹ insertions, seed 0x0516DC5ADD11) at fixed depth 12 (identity holds at every depth; the theorem depth for length 6 is 28) 64/64 exactly the identity
reduced length-8 words with S^(2) = 1 (the paper's §1.6 figure-of-8 class) 64 found, all separate at level 3, 3!·S_xxy = 6 for the canonical one
d = 1 fence: all 64 length-6 words on {a, a⁻¹} exactly 7 tensors (net increment only)
parity vs the existing f32 signature_d2_deg3 lane every lattice word of length ≤ 6, index-for-index
bit-exactness FNV digest 0x7C9612A734212FC6 over all words of length ≤ 3 at theorem depth
commutator a b a⁻¹ b⁻¹ 2!·S = (0, 2, −2, 0) — Lévy area 1

Disambiguation kept explicit: signature.rs remains the f32 depth-3 kernel-STABILITY battery; this lane is the UNIQUENESS half.

SIMD

Scalar integer reference lane by design. The W1.5 sigker vectorised lane (gated on this pillar, now unblocked) must reproduce these i128 tensors bit-for-bit; ndarray::simd has no i128 lane today, which is the loose end recorded in the blackboard.

Gates

cargo test --lib --features std,linalg,pillar lattice_signature → 11/11; doctest ok; cargo clippy --lib --features std,linalg,pillar -- -D warnings clean; cargo fmt --check clean. Blackboard entry added and corrected per the repo protocol.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QHVUi6Q9XtmKgxh6pDRayP

Summary by CodeRabbit

  • New Features
    • Added a deterministic lattice-signature analysis for unit lattice walks using exact integer arithmetic.
    • Added validation for input steps, overflow limits, word reduction, identity detection, and signature digests.
    • Added theorem-based depth calculations and reporting for separation, false merges, and one-dimensional limitations.
    • Added generation and evaluation of reduced and tree-like lattice words.
    • Exposed the Pillar-11 lattice proof and measurement report through the pillar module.

…certificate

New src/hpc/pillar/lattice_signature.rs (feature `pillar`). For unit-step
lattice walks every level-k signature coefficient has denominator k!, so
the lane stores k!·S_k as i128: identity is `==`, no tolerance anywhere.
Chen composition with a unit step is a binomial convolution against a
tensor supported on (a,…,a) only. Depth policy is integer:
theorem2_depth(L) = ceil(23959·L/10000) ≥ floor(e·ln(1+√2)·L), the
constant re-read from math/0507536v2 p.11/p.14; theorem3_factor(d) =
2·ceil(log3(d/2))+3 by integer loop. Overflow contract: len^depth < 2^126,
checked arithmetic, never wrapped.

Pinned: 484/484 reduced d=2 words of length ≤ 5 separated at the theorem
depth; 64/64 tree-like words exactly the identity; 64 reduced length-8
words share S^(2)=1 with the constant path (the paper's figure-of-8 class)
and all separate at level 3; d=1 collapses the 64 length-6 words to exactly
7 tensors; parity with the f32 signature_d2_deg3 lane on every lattice word
of length ≤ 6; FNV bit-exactness digest 0xBFAB3E55601E4E41;
prove_pillar_11_lattice() deterministic PillarReport.

signature.rs stays the f32 kernel-stability battery; this is the uniqueness
half, the ndarray twin of lance-graph jc::hambly_lyons W6 (lance-graph
#1133) with the f64 tolerance replaced by integer equality. Scalar integer
reference lane by design; the W1.5 vectorised lane must reproduce these
tensors bit-for-bit. Gates: 11/11 lane tests + doctest, clippy -D warnings,
fmt. Blackboard entry added.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QHVUi6Q9XtmKgxh6pDRayP
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 726ec4dd-a5cf-4289-8af5-2de35e225fd8

📥 Commits

Reviewing files that changed from the base of the PR and between 001aac4 and e1f0e72.

📒 Files selected for processing (3)
  • .claude/blackboard.md
  • src/hpc/pillar/lattice_signature.rs
  • src/hpc/pillar/mod.rs

📝 Walkthrough

Walkthrough

Added the Pillar-11 lattice-signature lane. It computes checked, factorial-scaled i128 signatures, applies integer depth policies, runs deterministic proof measurements, validates invariants, and exposes the proof entry point through the pillar module.

Changes

Pillar-11 lattice signatures

Layer / File(s) Summary
Signature contracts and computation
src/hpc/pillar/lattice_signature.rs
Defines lattice steps, signature types, depth calculations, word utilities, validation, and checked integer signature construction.
Deterministic proof measurements
src/hpc/pillar/lattice_signature.rs
Runs separation, tree-like identity, false-merge, one-dimensional, determinism, parity, and digest checks.
Public wiring and documentation
src/hpc/pillar/lattice_signature.rs, src/hpc/pillar/mod.rs, .claude/blackboard.md
Adds the LatticeLeg results, registers the module, re-exports prove_pillar_11_lattice, and records the implementation details.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant prove_pillar_11_lattice
  participant lattice_signature
  participant PillarReport
  Caller->>prove_pillar_11_lattice: request Pillar-11 proof
  prove_pillar_11_lattice->>lattice_signature: compute and compare lattice signatures
  lattice_signature-->>prove_pillar_11_lattice: return measurements
  prove_pillar_11_lattice->>PillarReport: build proof report
  PillarReport-->>Caller: return results
Loading

Suggested reviewers: claude

Poem

A rabbit checks each lattice line
With integers crisp and signs aligned
Tree-like paths return to rest
False merges face a depth-aware test
The pillar report records the proof

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@cursor

cursor Bot commented Sep 1, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_60f5a275-7761-49a9-8a36-80535043a3b5)

…nals Thm 5/6)

The lattice lane's depth policy used e·ln(1+√2) ≈ 2.3958 from the arXiv
math/0507536v2 preprint (Theorem 2). The published version — Hambly &
Lyons, Annals of Math 171 (2010), Theorem 5 — states ⌊2e·log(1+√2)·L⌋,
and its proof sets x = 2·log(1+√2)·L. CodeRabbit flagged the discrepancy
on lance-graph #1133; the Annals PDF confirms it. Integer policy is now
⌈47917·L/10000⌉ (upper bound on 4.79164…), and every doc/test names
Theorems 5/6 with the preprint's Thm 2/3 numbering noted as a version trap.

Consequences of the doubled depth: `LATTICE_L_MAX` drops from 5 to 3
(depth 19 at L=4 already allocates 2^19 coefficients per level; the old
L=5 arm hung at 2^24+), the tree-like arm runs at a fixed depth 12
(identity holds at every depth), the figure-of-eight test asserts
separation at depth 3, and the bit-exact digest is re-pinned over words
of length ≤ 3 (`0x7C9612A734212FC6`). Measured: 52/52 reduced words
separated, 64/64 tree-like identity, 64/64 depth-2 false merges
separated at level 3, d=1 collapses to 7 classes. 11/11 tests, clippy
-D warnings clean, fmt clean. Blackboard entry corrected to match.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QHVUi6Q9XtmKgxh6pDRayP
@AdaWorldAPI AdaWorldAPI changed the title pillar: bit-exact i128 lattice signature lane + Hambly-Lyons Thm 2/3 certificate pillar: bit-exact i128 lattice signature lane + Hambly-Lyons Thm 5/6 certificate Sep 1, 2026
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review September 2, 2026 14:15
@cursor

cursor Bot commented Sep 2, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_0e850d41-b5ba-413f-bad3-83768f6e69d0)

@AdaWorldAPI
AdaWorldAPI merged commit 90d4f8f into master Sep 2, 2026
20 of 21 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e1f0e7211d

ℹ️ 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".

/// bound `⌈47917·len / 10000⌉ ≥ ⌊2e·ln(1+√2)·len⌋`. No floating point.
#[must_use]
pub const fn theorem2_depth(len: usize) -> usize {
(THEOREM2_C_NUM * len + THEOREM2_C_DEN - 1) / THEOREM2_C_DEN

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid overflowing the integer depth calculation

On 32-bit targets, valid and representable results can overflow the numerator: for example, theorem2_depth(100_000) should return 479170, but 47_917 * 100_000 exceeds usize, causing a debug panic or a wrapped, insufficient depth in release mode. Compute the quotient and remainder without forming the full product, or use a wider checked intermediate, so this function preserves its advertised theorem bound.

Useful? React with 👍 / 👎.

for k in 0..=depth {
c[k][0] = 1;
for j in 1..=k {
c[k][j] = c[k - 1][j - 1] + if j <= k - 1 { c[k - 1][j] } else { 0 };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not overflow unused binomial coefficients

For an empty or one-step one-dimensional walk at depth 131, fits_i128 returns true and the actual scaled signature coefficients are all representable, but constructing Pascal's triangle overflows at C(131, 65). This makes a small, otherwise valid call such as lattice_signature(&[step], 1, 131) panic in debug builds and silently wrap the table in release builds, contradicting the stated overflow contract.

Useful? React with 👍 / 👎.

#[must_use]
pub fn letter(dim: usize, l: usize) -> Step {
if l < dim {
Step { axis: l as u8, sign: 1 }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve axes for dimensions above 256

When dim > 256, converting the generator index to u8 aliases higher axes: for example, letter(257, 256) returns axis 0 rather than axis 256. Consequently for_each_word(257, 1, ...) emits duplicates and can never enumerate walks using the final axis, while the public APIs and general-dimensional theorem helpers document no 256-dimension limit.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants