Skip to content

Research: recognition-indexed SSA refinement (RSSA) - #907

Merged
godofecht merged 25 commits into
mainfrom
research/recognition-ssa
Sep 30, 2026
Merged

godofecht merged 25 commits into
mainfrom
research/recognition-ssa

Conversation

@godofecht

@godofecht godofecht commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Introduces the first executable RSSA core combining ordinary SSA/effect refinement with Recognition Dynamics contracts and continuous attractor certificates.

Ported to Flow. The Python model (src/flow/recognition_ssa.py) and its pytest file are not added; src/flow was deleted in #1072 and the ratchet holds Python at zero. The model is now compiler/src/recognition_ssa.flow, built on compiler/src/recognition.flow from #1026:

  • FlowcAttractorSignature (fixed points, basin labels, stability, invariants), FlowcRecognitionContract (domain bit, epsilon, four weights), witnesses and a certificate.
  • Hausdorff distance on fixed points, Chebyshev on stability and invariants, basin-label changes as +inf. Malformed contracts (non-finite or negative epsilon or weights) are refused.
  • flowc_rssa_check takes the discrete judgement as a flag and the before/after signatures per contract, since the adapter supplies both. With no contracts, legality is exactly the discrete judgement.
  • flowc_rssa_contracts_from_flow lowers a recognize { ... } declaration into one contract per declared domain, with per-domain budget overrides; an override for an undeclared domain is an error.

tests/lang/test_recognition_ssa.flow covers the five Python tests plus a tighter-budget rejection, violation masks, a malformed contract and the undeclared-domain error. Mutating the basin comparison makes it fail (exit 8).

docs/research/recognition-ssa.md points at the Flow module.

Gates on this head: ./flow test-lang (RSSA and semantic stack tests), fmt_check.sh --check, parse_coverage.sh --check, bootstrap_from_c.sh --verify (module not in the flowc bundle, bootstrap unchanged), doc links, doc coverage, doc examples ledger, tool layout, python_ratchet.sh.

compiler/src/recognition_ssa.flow is the executable certificate model:
attractor signatures (fixed points, basin labels, stability, invariants),
contracts with an epsilon budget and weights, Hausdorff/Chebyshev
distances with basin changes as hard violations, and lowering of a
recognize declaration to contracts through recognition.flow. With no
contracts, legality is exactly the discrete refinement judgement.

tests/lang/test_recognition_ssa.flow covers the conservative extension,
mandatory discrete refinement, drift inside and outside the budget, basin
changes, malformed contracts and the recognize lowering. The original
Python model and pytest file are not added.
@godofecht
godofecht marked this pull request as ready for review September 30, 2026 14:00
@godofecht
godofecht merged commit 3dce697 into main Sep 30, 2026
30 checks passed
@godofecht
godofecht deleted the research/recognition-ssa branch October 1, 2026 12:50
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