r/MachineLearning · · 2 min read

I gave a repair tool exactly one worked example. It inferred the rest and fixed 5/5 bugs in code it had never seen — 4 CPU instructions, zero tokens.[p]

Mirrored from r/MachineLearning for archival readability. Support the source by reading on the original site.

You tell it one fact — fault kind 0 is repaired by act 5 — and it returns the act for any fault kind it's never been told about. The offset isn't stored; it's recovered from the worked example on every call, so you can renumber your act codes freely and nothing breaks. A lookup table is wrong on 15 of the 16 renumberings. This is wrong on none.

The expression was authored by a program-synthesis engine, not by me. It appears in the repo verbatim — not hand-written, not hand-simplified. The engine's verdict was minimal in D∩I: no smaller expression exists in the space it searched. I tried independently to beat it and tied exactly.

What's verified:

all 2^32 inputs vs an independent reference 0 mismatches each act 0-15 occurs exactly 2^28 times uniform partition bits 12-31 influence the result never (exhaustive, not sampled) emitted arm64 4 instructions: lsr, sub, add, and 

Then I pointed it at code it had never seen — idioms from funcy, a chunking loop, cachetools-style TTL arithmetic, a sortedcontainers-style bisect bound — one single-line fault each:

repaired 5/5 EXACT 5/5 10.3s 0 tokens 

Exact means byte-identical to the intended source, not merely "the test suite went green." That distinction matters: a weak suite will happily accept a wrong edit, and I've watched other repair tools do exactly that.

A bug I found while running it, because it's the more useful half of this post: the pipeline executed candidates with no timeout. Act 6 decremented a literal until a loop counter advanced by zero — a non-terminating candidate — and the whole thing hung for 595 seconds and produced nothing. With a 5-second per-candidate bound, the same corpus finishes in 10.3s at 5/5. If you're building anything that runs mutated code, bound it; mutation into an infinite loop isn't an edge case, it's a routine consequence of an off-by-one applied to a loop variable.

Honest limits, all measured and in the README:

  • The four-act vocabulary covers ~63% of live mutants on real repos. Boolean swaps, not removal and multiplicative flips have no act and are never repaired — correctly, since there's nothing to route to.
  • It cannot recover an arbitrary permutation of act codes from one example — and neither can anything else: one pair is consistent with 15! relabellings, exactly one of which is a translation. Recovering a permutation needs all 16 pairs, which is the lookup table itself.
  • Localisation is not solved. The router costs ~656 ns; one candidate verification costs 28.6 ms. The search over lines is ~44,000× the routing decision, and it's the entire cost.

https://github.com/devkancheti4-design/fluid-router

submitted by /u/No-Program-5087
[link] [comments]

Discussion (0)

Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.

Sign in →

No comments yet. Sign in and be the first to say something.

More from r/MachineLearning