Skip to content

Add bounded algorithm search for FX and Beetle with controlled benchmarks - #2

Merged
skishore23 merged 2 commits into
mainfrom
feat/program-discovery
Oct 31, 2026
Merged

skishore23 merged 2 commits into
mainfrom
feat/program-discovery

Conversation

@skishore23

@skishore23 skishore23 commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

FX now searches algorithms with loops, branches, early exits and indexes, checks independent correctness references, and exports accepted winners as JSON or ordinary FX steps. An optional model proposer uses the existing provider interface; candidates are interpreted data, with no arbitrary source execution.

Targets and measured results

  • FX memory filtering: the oracle calls the actual getMemory API. A guarded reverse scan preserves filter, order and unusual finite-limit behavior. All 10 withheld cases pass; modeled steps decrease from 113,056 to 33,578. Twelve incorrect candidates are rejected.
  • Beetle-compatible batch route readers: a preferred-reader index passes all 3 withheld batches. Modeled steps decrease from 409,613 to 45,615 including index construction; nine incorrect candidates are rejected. This is a synthetic reference target, not native Rust conformance or full routing/authorization qualification.
  • Each selected algorithm also passes 60 additional generated regression inputs/batches.
  • The original abstraction and scheduling experiments remain. Learned abstraction reuse still matches saved snippets.

These are interpreter cost-model reductions, not native speedups. The deterministic search explores authored structural grammars. The model adapter is mock-tested; no live provider run or globally new algorithm is claimed.

Implementation

Inspectable JSON control flow; isolated inputs; step/allocation/depth limits; local indexes; immutable training feedback; separate training, validation and final cases; an explicit baseline fallback; no reselection after final failure. Model-generated or externally supplied JSON proposals use the same evaluator. Rejected CLI results return nonzero and invalidate stale winner exports.

algorithmStep integrates a reviewed winner into existing agents. Search does not replace production code, activate policies, deploy, or change Beetle.

Run

npm ci
npm run algorithm:search -- --target fx-memory
npm run algorithm:search -- --target beetle-routes
npm run algorithm:search -- --target all --out ./algorithm-results

See docs/advanced/algorithm-search.md for custom targets and the optional model adapter. Reports, algorithms and source/output fingerprints are in examples/algorithm-search/results/.

Validation

193 library tests and 7 experiment checks pass, plus lint, type checking, build, whitespace and ESM export checks. Discovery code has 97.03% line / 82.17% branch coverage. CI runs both the original controls and the algorithm/model-adapter checks.

Limits

Finite cases are not a proof. Native timing, representative traces and native Rust conformance remain deployment gates. The interpreter work model does not bound trusted host proposers/references or provider-internal retries.

@skishore23 skishore23 changed the title Add experimental program discovery and controlled benchmarks Add bounded algorithm search for FX and Beetle with controlled benchmarks Oct 30, 2026
@skishore23
skishore23 marked this pull request as ready for review October 31, 2026 04:46
@skishore23
skishore23 merged commit 12c6420 into main Oct 31, 2026
3 checks passed
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