Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-architecture-mv/issues/2c28b5326317a207 # aien-architecture-mv Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers # E06: Bounded rewrite search versus manual rules Open · #249 · open 2026-10-18 19:00 UTC Imported from GitHub aien-dev/aien-architecture-mv#249, by drakestapleton Labels: ready-for-agent drakestapleton wrote on 2026-10-18 19:00 UTC ## Governing correction: replace and remove, no retained legacy code Drake clarified: there will be no legacy code; it will be replaced with .om. The final state is .om throughout the project's first-party implementations, including runtime, compiler, services, build/release tools, automation and project-owned tests. This supersedes any older wording permitting a permanent legacy/reference implementation, wrapper, foreign fallback or dual production path. For each component: implement and qualify its .om replacement, cut its consumers over, then delete the superseded implementation and obsolete build/runtime dependencies from the active tree. Old source may be consulted in Git history during replacement; do not keep it in an active legacy/reference directory. Existing code present during unfinished migration is an outstanding replacement task, never an accepted end state. Preserve historical Git commits and immutable evidence; do not rewrite history. Missing .om capabilities are implementation dependencies for the existing seed/compiler owners, not exemptions. Independent third-party qualification oracles may run outside the delivered source/build/runtime closure; replace project-owned legacy test implementations too. Generated machine code, non-executable data/documentation, external protocol formats and device firmware are separately inventoried and cannot disguise retained first-party logic. Interoperation with users' external software does not make that software part of the .om implementation. Acceptance includes an active-tree/dependency audit showing the old implementation and fallback are gone, .om consumer tests pass, and exact source/seed/binary/evidence identities are recorded. Coordinate existing owners and release gates; replacement is complete only after deletion and consumer qualification. Part of the necessary-work programme (epic: "Necessary-work programme: make the necessary work the limiting factor"). Plan section 6, row E06, priority P1. Status: NOT_RUN. Docs: plan , feasibility research . In plain words: Bounded rewrite search finds reductions missed manually. Hypothesis and predicted observation. Bounded rewrite search finds reductions missed manually. Discriminating experiment and controls. Fixed CPU budgets; compare manual rules, greedy rewrites and bounded equality exploration; proof-check each accepted derivation; outside crates are research only, a native version is built if E04 shows the need. Decision / deliverable. Net savings including search; rewrite set and counterexamples; no "optimal" label on timeout. Depends on. E04. Who does it. Plan role code: MATH + OMEGA. Fable 5.1 or Grok 4.7 for the proofs and bounds (MATH/REVIEW); Opus 5.5 for any build work; a different model reviews than built. Gates before promotion (plan section 9): G0 reproducible baseline (pins, hashes, device state), G1 trustworthy measurement, G2 correctness including mutants, G3 detectable benefit with predeclared effect size and repetitions, G4 full cost including search and fallback, G5 causal out-of-sample prediction, G6 independent reproduction. A faster incorrect candidate is a failed experiment. Reporting rule. Seconds and joules per accepted objective and watts, each beside its physical bound with derivation and calc id, the same figure from our previous run, and the distance to the ceiling. Tokens and bytes are supporting facts only. Track C reports Turing yield T and T/J once TY-x exists; until then the acceptance-gate figure alone, labelled. No outside comparisons, no durations, no percent targets. Joules are UNMEASURED until an on-board or wall-meter instrument is named. Evidence. One append-only campaign folder (omega-mv evidence//README.md or sovereign-core-mv docs/inference/evidence//) using the plan section 10 fields plus claim_strength (proven_in_scope, measured, inferred, unresolved). GPU runs: quietlock check first, never killed, Spark judges, results land through the PR desk. ## Wolfram-method extension: checked elimination ranked by actual cost (2026-10-19) Coordinate with #276, omega-mv#583 and omega-mv#584; this is an extension of E06, not another rewrite engine. Study Wolfram's documented FullSimplify Assumptions/ComplexityFunction method (https://reference.wolfram.com/language/ref/FullSimplify.html ). We have not inspected proprietary simplifier internals. Public indexed-matching example: https://github.com/maxitg/SetReplace/blob/`44c868bf4622e4542b306846ffdcc47c19d0bba8`/libSetReplace/AtomsIndex.cpp . Borrow methods using the native toolchain; no Wolfram runtime dependency. Current source observation: omega src/omega_synthesis.c at `a8ffd2b912c84197d08f963b05f9c7d8b30a3f8a` computes signatures over six probe inputs, and omega_synth_equiv_contains_or_add prunes by signature and instruction-count cost. This is observational matching, not general equivalence proof. Recheck current code and related fixes before edits. Deliver: - Versioned rewrite contracts with numeric domain/width, overflow/rounding semantics, shape, aliasing and effect conditions; each accepted deletion/rewrite carries a checkable derivation. - Distinguish proven equivalence from probe agreement. Probe signatures may group candidates heuristically but must not authorize semantic substitution; evaluate search completeness loss separately. Add counterexamples agreeing on probes but differing elsewhere within the tested grammar when possible. - Compare manual rules and instruction-count ranking against bounded cost-guided search using existing rx_costmodel and #583; eligibility before ranking. Unknown cost never becomes zero. - Test real identities separately from machine arithmetic. Negative cases include missing sign assumptions for sqrt(x*x), overflow-domain mismatch and floating-point reassociation. Do not enable unsupported operations merely to demonstrate an identity. - Optional atom/op/type indexing only if profiling shows matching overhead; measure index update/storage costs against scans and reject it if net worse. Acceptance: freeze budgets and held-out cases; invalid assumptions/mutants rejected; independent derivation checker; same accepted outputs/contracts; measure total search+checking+execution cost and memory, not expression size alone. Cache derivations under their assumptions and invalidate on changed semantics. Timeout means best found under budget, never globally optimal. Preserve E04 dependency and all existing gates. ## Computerphile optimization follow-through: bounded native equality saturation This existing E06 owns the work; do not create another optimizer. Research: egg, https://doi.org/10.1145/`3434304` . Preserve E04 prerequisite and #261/#248 validation ownership; integrate omega-mv#623 and #583/#522 contracts. - Implement the smallest .om e-graph/rewrite experiment for a declared pure integer subset through existing seed ownership. Bound nodes, bytes, iterations, matching and wall/work budget; use scheduling/backoff for expansive rules. - Rules carry width, overflow/trap, effect, alias and resource/fuel conditions. E-graph membership and probe agreement alone are not proofs. Independent checker validates each accepted substitution; no arbitrary floating-point reassociation. - Compare manual, greedy and bounded equality search with identical budgets and held-out workloads; include wrong-rule/assumption mutants and cases where search never repays its cost. - Cost extraction consumes measured operation/traffic/preparation/check costs; charge matching, rebuilding, analysis, extraction and validation. Validate whole-consumer speed and peak memory, not only instruction/expression size. - Timeout returns the best validated candidate found or incumbent, never global optimality. Keep search exploration separate from deployment; preserve #600's bounded exploration ownership. - Replace superseded project-owned code in .om and remove old implementations under #300; export fixtures to omega-mv#624. External egg is research/oracle material, not a production dependency. No comments. Sign in to comment