Repository navigation
Open
Description
Classification
- Type: bounded research spike / P3 backlog, not an implementation request for a new production optimizer.
- Area: hot, pure and explicitly specified helper functions in the existing Roslyn → OwnIR → Rust ownership-analysis pipeline.
- Source: Superoptimizing an FPU emulator (2026-10-16).
- Prior art: Souper (LLVM IR; archived 2025-10-30), egg (e-graphs/equality saturation), Alive2 (LLVM IR translation validation). None is a drop-in verifier for C#/OwnIR/Rust semantics.
- Related, not replaced: Research: FORVES2-style conditional semantic validation and proof-assumption audit for OwnIR #445 (conditional semantic validation), Research: Cilica-style analysis invalidation and pass verification for OwnIR (bounded spike) #456 (pass/IR validation), Research: evidence-guided candidate ranking for Own.NET analyzer fixes (LoopRepair prior art) #440 (fix ranking), Research: refactoring-aware metamorphic regression testing for ownership analysis (RefactoringMiner prior art) #432 (refactoring-aware metamorphic regression), IDE foundation: establish cold/warm/incremental latency and memory baselines #263 (performance baselines).
Hypothesis
For one demonstrably expensive, pure helper, a narrowly defined expression grammar plus semantic deduplication can reveal an equivalent cheaper implementation that manual refactoring or the compiler misses. This is not a proposal to rewrite the ownership analysis or its diagnostic semantics.
The blog enumerates expressions, deduplicates by vectors of results on ~20 tests and manually identifies subexpression reuse. Test-vector equality is a search heuristic, not proof. A four-operation expression also need not mean a faster machine-code implementation.
Kill-first protocol
- Establish need: profile existing workload and identify at most 1–2 actual hot pure functions (e.g., a state-transition/bitset helper only if one really exists). Pin code SHA, inputs, benchmark harness and semantics. KILL immediately if there is no meaningful hot spot or a standard compiler optimization already solves it.
- Fix semantics: specify allowed inputs, integer widths, overflow/shift behavior, undefined/invalid states, order/side effects, and target runtime. Exclude allocations, exceptions, aliases, lifetime/Dispose effects, interprocedural and WPF behavior from synthesis.
- Small search: restricted operators/constants; enumerate trees or use e-graph rewriting; retain shared-subexpression DAGs in cost accounting; deduplicate by test-output vectors; generate edge cases and counterexamples.
- Independent validation: exhaustive evaluation on a tractable bounded domain or SMT proof under explicit assumptions, plus compiler/build tests and differential/metamorphic regression. If equivalence is unproved, label
UNVERIFIEDand do not propose production replacement. Alive2 only if the candidate has genuinely equivalent LLVM IR semantics; no automatic claim of .NET/Rust proof. - Measure: compare current implementation, optimized compiler baseline and generated candidate on representative workloads. Record correctness verdict, counterexamples, instruction count where meaningful, latency, throughput, allocation, memory, portability and maintainability cost.
Deliverables / decision gate
- Reproducible self-contained spike with frozen inputs, exact versions/SHAs, candidate grammar and results.
- Candidate + counterexample/proof receipt + before/after benchmark, or a documented negative result.
- GO only for a verified rewrite with reproducible useful improvement and acceptable complexity; CHANGE for a reusable verifier/test generator only; KILL for no hot spot, insufficient proof, or negligible benefit.
- No production integration, broad synthesis framework, or auto-fix roll-out as part of this issue.
A separate, architecture-level code-pattern recommender is documented in Pattern-Aware Refactoring; that is not Own.NET's remit.
Metadata
Metadata
Assignees
Labels
No labels
Activity
PhysShell commentedon Nov 15, 2026
Additional prior art: OpenEvolve (Asankhaya Sharma)
Source: algorithmicsuperintelligence/openevolve, an LLM-guided evolutionary program-search framework with external evaluators and population-based search.
Please treat this as an optional search baseline inside #459, not a new optimization project. The existing issue's pure, explicitly specified OwnIR helper / independent semantic-equivalence gate stays authoritative.
Suggested comparison only after #459 identifies a real measured hotspot and a trusted oracle:
Useful high-level donor: proposal/search/evaluator separation and archived candidate provenance, not automatic code replacement.