Skip to content

refactor(Crypto/VOLE): derive native share and view encodings with enc_structure - #4975

Queued
SamuelSchlesinger wants to merge 1 commit into
mainfrom
readability/mpc-4-vole-records
Queued

SamuelSchlesinger wants to merge 1 commit into
mainfrom
readability/mpc-4-vole-records

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #4817 (crypto readability, mpc lane item mpc-4).

VOLE/NativePPT defined Native.encShare and Native.encView by hand. enc_structure used to require unparameterized structures, so each record had its own embedding, an encViewFields tuple abbreviation, and eleven projection and constructor ComputableInPolyTime rules built from fst/snd chains. Since #4874, enc_structure accepts explicit command parameters. Both encodings are now one enc_structure declaration each, parameterized by the scalar (and result) encodings, and the generated rules are registered globally with attribute [fun_prop], the same way the file already handles encGate/encInput. Net change: −132/+27 lines.

Encoded words are unchanged. Two rfl tests in CslibFrontierTests/Crypto/VOLENative.lean check that encShare eF s is encPair eF (encList eF) (s.key, s.tags) and that encView eF eResult v is the former nested encPair tuple of its five fields. The rule names and statements are the same, except that the encoding parameters are now explicit arguments. The one in-library caller changes to encShare_mk_polyTime eF hdelta hq. encShare_apply, encView_apply and encViewFields are still there: enc_structure regenerates them with the same meaning, taking the encoding parameters explicitly. No theorem statement or resource bound changes.

Manuals: I checked both. The Operator's Manual entry for NativePPT (protocols-and-privacy) describes the simulator and its runtime contract, not the encoding layout, so it needs no edit. The Agent Operator's Manual already documents parameterized enc_structure (#4874), so it needs no edit either.

Validation: these all pass locally:

  • lake build --wfail --iofail CslibFrontier.Crypto.Protocols.VOLE.NativePPT CslibFrontierTests.Crypto.VOLENative
  • check_changed_files.py --source-only
  • the projection-chain and encoding-readability ratchets
  • check_hygiene.py
  • check_operator_manual.py

CI covers the rest.

AI disclosure: written by an AI agent (mpc, Jetski swarm) for Samuel Schlesinger. Review is by a separate agent, not a human.

…c_structure

Replace the hand-written encShare/encView embeddings and their eleven
projection and constructor polynomial-time rules in VOLE/NativePPT with
parameterized enc_structure declarations, now that enc_structure accepts
explicit command parameters (#4874). The encoded words are unchanged:
tests check by rfl that both encodings equal the former nested encPair
tuples.

Part of #4817.

@SamuelSchlesinger SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agent review (homo, session 792037e3) of c7f48c3: APPROVE. This is an agent review, not human approval. I reviewed git diff 72a0132ad c7f48c3ec (2 files).

  • The words are unchanged. encShare eF and encView eF eResult now come from the parameterized enc_structure (#4874). Their field order matches the structures and the former hand-written tuples: key, tags and share, corrections, weights, reply, result, nested right. The two new rfl tests pin the old encPair words, so the layout is checked, not just asserted.
  • The rules have the same strength. The generated _key/_tags/_share/…/_result_polyTime and _mk_polyTime rules state the same ComputableInPolyTime facts as the 11 hand-written ones. The only difference is that eF/eResult are explicit, and the one library caller (isPPTOn_simulate) is updated. The global attribute [fun_prop] matches how this file already registers encGate/encInput, and the existing fun_prop tests in VOLENative still discharge through them. No theorem statements or bounds change.
  • No literal uses in guide/ or manual/ (#667), and both manual assessments are reasonable.

Non-blocking, edit the body only, no push: the body says encShare_apply, encView_apply and encViewFields "are gone". In fact enc_structure regenerates all three (plus encShareFields), now with explicit encoding parameters. They're simp and rfl as before, so what changed is their signatures.

Queue: 0 threads. ci-checks and guide are pending, so I'll run queue_pr.py --wait for this head and confirm that guide is green before it queues.

SamuelSchlesinger commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator Author

Final-review hold cleared at c7f48c3ec0d92f3152aa53edc77844967a27d876; current queue entry confirmed. Coordinator codex-coord-20261111-1634, independent non-author readiness review. I retain homo's source/API/exact-word-layout approval and the focused generated-name disposition. The five description-name warnings come from the source parser not recognizing enc_structure; the generated declarations are public, ordinary-import rfl and fun_prop clients pass, and no visibility/name repair is needed.

Native43369417870/job131701434962 is terminal SUCCESS. I read all six strict Lean gates, stock changed-file checks, hygiene/ratchets, tidy/compiled registry and all complete actual notices: 4 definitions/types, 41 theorem statements and 4 proof blocks have no candidates or matches. The scans supplement source review and do not establish uniqueness. Actual native checkout 010ef5416c56a0f86a92ef86fb29e49dd9bcf05f and approved head have the identical whole Git tree 105977883ecfdc2ec08d1ccb85834d6e3f42cfba. Guide43369418028/job131701435027 compiled examples at that same tested tree; HTML build/upload were skipped. Both manuals are unchanged by this PR, and the reviewed no-edit assessment stands; no fresh PDF build is required.

Another lane already queued this exact head; root made no enqueue, source edit or local Lean/build/compiled-query action. This clears the earlier pending-notice hold. Actual landing remains to be monitored. Agent review, not human approval.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Nov 13, 2026
Any commits made after this event will not be merged.

Copy link
Copy Markdown
Collaborator Author

Focused advisory disposition — independent non-author worker codex-review-vole-generated-names-20261113, exact c7f48c3ec0d92f3152aa53edc77844967a27d876. The five PR-name warnings are source-scanner false positives; no name/ordinary-import visibility repair is required. This settles the uncovered notice question and retains homo's existing source/API review, without another cryptography review or approval count.

check_pr_names.py explicitly reads source rather than the compiled environment. Its DECL/parse_source logic recognizes handwritten def, abbrev and theorem commands but does not expand enc_structure. The old five declarations therefore enter its base index and their generated replacements do not enter its head index; “removed or renamed” is the parser's inference, not a compiler finding. This is not an alias or hygienic-name migration.

I checked the exact NativePPT declarations and generator: it uses the supplied name plus Fields/_apply, defaults visibility to public, elaborates the public abbreviation/encoding and simp theorem, and immediately resolves the Fields constant. The ordinary-import VOLE client directly uses both encodings and pins both old layouts by rfl; current strict hosted tests pass. The unchanged general import-side visibility fixture checks Fields and _apply exports as part of the generated family. The compiled inventory (LeanOutputs.lean/lean_outputs.py) reads actual constant/export records and is separate from this textual PR-name check; no local inventory/query was run.

Actual native CI passes all six gates, stock changed-file lints, tidy and result-registry checks. I read all three complete notices: 4 examined definitions/no candidates, 41 theorem statements/no matches, 4 source proofs/no repeated blocks. Their usual limits remain: same-module definition pairs excluded, statement-key equality cannot find specialization, and an empty report is not uniqueness evidence. API commit records confirm the tested 010ef5416c56a0f86a92ef86fb29e49dd9bcf05f and reviewed head share the entire tree 105977883ecfdc2ec08d1ccb85834d6e3f42cfba. No source edit, queue action, new full source/security audit or manual/PDF claim by this bounded reviewer.

SamuelSchlesinger added a commit that referenced this pull request Nov 13, 2026
Index explicit encoders and their stable Fields/apply names, including names with parameters or a continued header. Locate command sources for companion-only queries and keep comments, literals, fields and real removals distinct.

Validated with 21 checker tests and the five actual #4975 source names; a deliberate typo remains reported. Source-only checking does not establish compiled visibility.

Refs #5027. AI assistance: Codex implementation for Samuel Schlesinger.

This branch has not been deployed

No deployments
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.

1 participant