Complete fixed native program for one Chan–He node #
The source comparator is NodeArray.lean at
anthropics/formal-math@16a5ce41304fcdaea4e0be7c132e1c361dc26da5.
The layout, native code and proofs are original. The source's Light machine is not imported.
Main definitions #
NodePacking.program: computes the layout and tags, pads every output cell, then performs three actual residue/histogram/extraction/placement calls, including all three count stores.
References #
The three supplied signed input bases.
The three supplied input lengths.
Fresh allocation base after all input arrays.
Common number of four-cell groups.
Node input magnitude bound.
Positive modulus.
Computed residue workspace base.
Computed histogram workspace base.
Computed packed output base.
Twice the gap G=6U+4, ready for sign-and-magnitude tagging.
Twice the padding magnitude W=2U+1.
Setup scratch.
Constant one, retained across the complete calls.
Constant four, retained across the complete calls.
The mathematical layout determined by the runtime parameters.
Padding workspace embedded below all persistent node parameters.
Packed output base.
Number of four-cell groups.
Padding word for column zero.
Padding word for column one.
Padding word for column two.
Padding word for column three.
Compute every permanent and scratch block address in twelve native instructions.
Compute the exact positive encoded padding pattern, including all signed-negation/tag work.
The third padding word uses subtraction because its integer contribution is -W.
Compute the selected heavy-array descriptor address. The choice is one of three fixed pieces of code, never a program whose size depends on an input length.
Deliver the exact encoded tag for one fixed column.
Deliver the duplicated-Z distance; the other columns perform two coincident stores.
Every runtime input and output parameter is explicitly delivered to the complete call.
Complete one-set native round with charged setup and a written heavy count.
Complete charged address/tag/padding initialization.
Complete one-node preprocessing. This code is independent of n,w,M,N,U.
The original three input bases/lengths and base, length, magnitude and modulus parameters are preserved by the complete program.
The assembled code length has a fixed bound, independent of every runtime parameter.
The complete program is deterministic and never reads the word width.
No instruction samples randomness or invokes an oracle.