Repository navigation
Add bounded algorithm search for FX and Beetle with controlled benchmarks - #2
Merged
Merged
Conversation
skishore23
marked this pull request as ready for review
October 31, 2026 04:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
getMemoryAPI. 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.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.
algorithmStepintegrates a reviewed winner into existing agents. Search does not replace production code, activate policies, deploy, or change Beetle.Run
See
docs/advanced/algorithm-search.mdfor custom targets and the optional model adapter. Reports, algorithms and source/output fingerprints are inexamples/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.