Implements the YaFF-inspired separation of schema, layout, and access pattern
in Core/SilverSight/Semantics/:
- Schema.lean: fixed-size Schema typeclass with byteSize and wellFormed.
- Layout.lean: Layout enum, AccessProfile cost model, and cost-based selector
with an ε-suboptimality theorem.
- WireFormat.lean: certified encode/decode/roundTrip/encode_size structure.
- View.lean: zero-copy View with address-arithmetic invariant.
- LayoutBridge.lean: certified layout-conversion structure and identity bridges.
- CanalLayout.lean: CanalRegime enum and regime-aware layout selection.
Also updates:
- lakefile.lean: adds SilverSight.Semantics.* roots to SilverSightCore.
- docs/ARCHITECTURE.md, RRC_REFACTOR_READINESS.md, PROJECT_MAP.{md,json},
build_logs/2026-06-21_session_build_baseline.md, and GLOSSARY.md.
- AGENTS.md: build baseline, blessed surfaces, and pending proof work.
Build: 2987 jobs, 0 errors (lake build)
Tests: Python 21/21, Lean/C 35/35
11 KiB
Build Log: 2026-06-21 — SidonSets Restoration & SilverSight Porting Graph
Session Summary
Restored CoreFormalism.SidonSets.lean to the active SilverSight build, hardened the
SilverSight core surface, and generated a searchable Research Stack porting graph to guide
the long-term migration of provably useful math/concepts from Research Stack.
Build Baselines
All builds run against SilverSight main at 8f1d30d with toolchain
leanprover/lean4:v4.32.0-rc1.
| Command | Jobs | Errors | Notes |
|---|---|---|---|
lake build |
2978 | 0 | Default build target |
lake build SilverSightFormal |
3118 | 0 | Full formal library |
lake build CoreFormalism.SidonSets |
2601 | 0 | Narrow target after restore |
lake build CoreFormalism.SieveLemmas |
2402 | 0 | Ported sieve foundation |
lake build CoreFormalism.InteractionGraphSidon |
2530 | 0 | Ported interaction-graph module |
lake build CoreFormalism.BraidEigensolid |
2680 | 0 | Ported braid eigensolid |
lake build CoreFormalism.BraidSpherionBridge |
2745 | 0 | Ported spherion bridge |
What Was Ported / Restored
Core formalism modules
CoreFormalism.FixedPoint— canonicalQ16_16fixed-point surfaceCoreFormalism.Tactics— common tactics for the projectCoreFormalism.Q16_16Numerics— numeric helpers overQ16_16CoreFormalism.DynamicCanal— dynamic canal infrastructureCoreFormalism.Bind— binding layerCoreFormalism.BraidBracket— braid bracket primitivesCoreFormalism.BraidStrand— strand modelCoreFormalism.BraidCross— crossing modelCoreFormalism.BraidField— braid field operationsCoreFormalism.SidonSets— Sidon sets, extremal function, bounds, Singer theoremCoreFormalism.SieveLemmas— sieving lemmas for Sidon constructionsCoreFormalism.InteractionGraphSidon— interaction graph + Sidon labelingCoreFormalism.BraidEigensolid— eigensolid fixed-point theoryCoreFormalism.BraidSpherionBridge— braid/spherion bridge
Python tooling / tests
tests/test_q16_canonical.py— 10 green tests asserting canonicalQ16_16semanticstests/quarantine/q16_roundtrip_test.legacy.py— archived; waits on C bridge restoration.github/scripts/glossary_lint.py— warns when docs introduce undefined terms
Documentation / contracts
docs/GLOSSARY.md— living dictionary with standard-terminology crosswalkdocs/GLOSSARY_ALLOWLIST.md— allowlist for glossary lintdocs/TESTING.md— unit/integration/CI testing contractdocs/research_stack_usage_graph.{json,md,dot,svg,png}— searchable 13k-entity graph of Research Stack usagedocs/research_stack_porting_candidates.md— prioritized porting shortlistCITATION.cff— updated with module-specific reference notes
SidonSets Restoration Details
The module was quarantined because a chaos-game appendix used invalid Lean syntax and out-of-scope identifiers. Restoration steps:
- Removed the broken chaos-game appendix entirely.
- Replaced LaTeX-style escapes (
\Z,\N) withInt/Natin comments. - Introduced local
abbrev Z := Intandabbrev N := Natto avoid auto-implicit shadowing. - Fixed finset decidability issues and omega/linarith failures by normalizing to
Natwhere appropriate. - Verified with narrow and full library builds.
Research Stack Usage Graph
Generated a cross-reference graph from the Research Stack checkout at
/home/allaun/Research Stack:
- Nodes: 13 000+ files, modules, and concepts
- Edges: 13 000+ import / usage / reference relationships
- Outputs: JSON, Markdown, GraphViz DOT, SVG, PNG
- Purpose: convert the legacy Research Stack into a searchable point graph so useful math, code, and goals can be located and ported deterministically.
CI / Contract Updates
.github/workflows/lean-check.yml— Lean build gate.github/workflows/python-check.yml— Python test + glossary lint gate.github/workflows/doc-sync.yml— documentation sync gatedocs/generate_project_map.py— regenerable project map generator
Generated Artifacts
docs/PROJECT_MAP.md— human-readable SilverSight project map (77 files, 10 layers)docs/PROJECT_MAP.json— machine-readable project map (schemasilversight_project_map_v1)
Invariants Upheld
- No
Floatin any Lean compute path. ofFloatonly permitted at JSON/sensor boundaries.- Library-method architecture preserved:
Core/imports nothing; libraries import onlyCore/or Mathlib; no library imports another library. Q16_16unified toCoreFormalism.FixedPoint.
Next Recommended Work
- Restore C bridge for
Q16_16roundtrip tests. - Port additional Research Stack modules identified in
docs/research_stack_porting_candidates.md. - Add
#evalwitnesses / roundtrip proofs for remaining core modules perdocs/TESTING.md.
RRCLib Port (this session)
Ported Research-Stack RRC decision surface into SilverSight as a new library.
Files added
formal/SilverSight/RRCLogogramProjection.lean— RRC shape/logogram admission gatesformal/SilverSight/ReceiptCore.lean— receipt kinds, ledger, andtoSilverSightReceiptbridgeformal/SilverSight/RRC/Emit.lean— 6 canonical fixture rows, alignment gate, JSON emitterformal/SilverSight/AVMIsa/{Types,Value,Instr,State,Step,Run,Emit}.lean— AVM ISA + canary bundleformal/RRCLib/— user-facing symlinks to the SilverSight modulesexe/RrcEmitFixture.lean— executable that emits the fixture corpus JSONpython/pist_matrix_builder.py— PIST 8×8 matrix builder (I/O only)python/validate_rrc_predictions.py— emitted JSON validator (I/O only)
Build verification
| Command | Jobs | Errors | Notes |
|---|---|---|---|
lake build |
2981 | 0 | Default target |
lake build SilverSightRRC |
2992 | 0 | New RRC library |
lake build SilverSightCore |
3132 | 0 | No regression; FixedPoint now in Core |
lake build SilverSightFormal |
3132 | 0 | No regression |
lake build rrc-emit-fixture |
— | 0 | Executable JSON emitter |
Deviations from source
- Skipped the 250-equation corpus; added
emitFixtureCorpusfor the 6-row fixture corpus. - Moved canonical
FixedPointtoCore/SilverSight/FixedPoint.lean;formal/CoreFormalism/FixedPoint.leanis a compatibility shim. - Actual Lean modules live under
formal/SilverSight/;formal/RRCLib/holds symlinks so the requested paths exist.
Final verification run
| Gate | Result |
|---|---|
lake build |
✅ 2981 jobs, 0 errors |
lake build SilverSightCore |
✅ 3132 jobs, 0 errors |
lake build SilverSightFormal |
✅ 3132 jobs, 0 errors |
lake build SilverSightRRC |
✅ 2992 jobs, 0 errors |
lake build rrc-emit-fixture |
✅ green |
python3 -m py_compile python/pist_matrix_builder.py python/validate_rrc_predictions.py tests/test_q16_canonical.py .github/scripts/check_doc_sync.py .github/scripts/glossary_lint.py |
✅ green |
python3 .github/scripts/glossary_lint.py |
✅ no warnings |
python3 .github/scripts/check_doc_sync.py |
✅ OK |
rrc-emit-fixture | validate_rrc_predictions.py |
✅ OK: 6 rows |
pytest tests/test_q16_canonical.py |
⚠️ skipped — pytest not installed |
Later same day: RRC module ports and Q16_16 cross-language roundtrip
What changed
- Ported three Research Stack RRC gates into
formal/SilverSight/RRC/:ReceiptDensity.lean— Q16_16 receipt-density scoringPolyFactorIdentity.lean— divisor-sum signature gate (E8Sidon surface stubbed)EntropyCandidates.lean— 10 braid-state fixtures usingCoreFormalism.BraidEigensolidtypes
- Added a Lean ↔ C ↔ Python Q16_16 roundtrip test:
c/q16_canonical.c— canonical saturating Q16_16 C libraryexe/Q16_16Roundtrip.lean— Lean executable linked via Lakeextern_libtests/test_q16_roundtrip.py— Python ↔ C roundtrip harness (revived fromtests/quarantine/q16_roundtrip_test.legacy.py)
- Updated
lakefile.leanwith theq16-roundtripexecutable and theextern_lib q16_canonicalbuild target.
Build baselines
| Command | Jobs | Errors | Notes |
|---|---|---|---|
lake build |
2981 | 0 | Default target |
lake build SilverSightRRC |
3006 | 0 | RRC decision surface incl. new gates |
lake build q16-roundtrip |
5949 | 0 | Lean ↔ C executable |
Test results
| Test | Result |
|---|---|
python3 tests/test_q16_roundtrip.py |
✅ 21 tests passed |
.lake/build/bin/q16-roundtrip |
✅ 35 Lean ↔ C tests passed |
Later same day: Phase 1 core — schema / layout / wireformat modules
What changed
Implemented the YaFF-inspired Phase 1 Core modules in
Core/SilverSight/Semantics/:
Schema.lean— fixed-size schema contract (byteSize,wellFormed).Layout.lean—Layoutenum,AccessProfile, Q0_16Layout.cost,chooseLayoutByCost, and an ε-suboptimality theorem.WireFormat.lean— certified encoder/decoder structure (encode,decode,encode_size,roundTrip) with row-major instances forUnit,Bool, andUInt8.View.lean— zero-copy view contract (base,offset,valid) and areadUInt8accessor backed by address-arithmetic.LayoutBridge.lean— certified layout conversion structure and identity bridges.CanalLayout.lean—CanalRegimeenum andchooseLayoutoverride on top of the pure cost model.
Updated lakefile.lean to add all new SilverSight.Semantics.* modules to
SilverSightCore. Updated docs/ARCHITECTURE.md, AGENTS.md,
docs/RRC_REFACTOR_READINESS.md, and SilverSight_Spec.md to reflect the
new Core surface.
Build baselines
| Command | Jobs | Errors | Notes |
|---|---|---|---|
lake build |
2987 | 0 | Default target now includes Semantics core |
lake build SilverSightCore |
2987 | 0 | Core + Semantics modules |
lake build SilverSightRRC |
3006 | 0 | RRC decision surface |
lake build q16-roundtrip |
5949 | 0 | Lean ↔ C executable |
Verification results
| Test | Result |
|---|---|
python3 tests/test_q16_roundtrip.py |
✅ 21 tests passed |
.lake/build/bin/q16-roundtrip |
✅ 35 Lean ↔ C tests passed |
python3 .github/scripts/glossary_lint.py |
✅ no warnings |
python3 .github/scripts/check_doc_sync.py |
✅ OK |
Notes
Semanticsmodules import onlySilverSight.FixedPointand Mathlib, preserving the library-method rule that Core may not depend on libraries.- The full
DynamicCanalphysics remains inCoreFormalism.DynamicCanal;CanalLayoutis the Core-side abstraction that will be driven by it. - Concrete
WireFormat/LayoutBridgeinstances for product types such asBraidStateare left as library extensions.