October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Rebuilding Encarta Showed Me Where AI-Written Code Breaks

A reported reconstruction of LHA’s -lh5- method passed tested decoder round-trips but rarely matched the original encoder byte-for-byte on compression-heavy cases.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The experiment behind this title did not rebuild Microsoft Encarta. Jean-Luc Martel’s reported test reconstructed the behavior of the LHA -lh5- archiver, then compared the output with a hidden original implementation. Its results show a more precise lesson than “AI code breaks”: a decoder can pass round-trip tests while an encoder still fails to reproduce the original bytes, and a test suite can miss the very behavior it is meant to evaluate.

What the Encarta title refers to

The exact title appears on a DEV Community tag page, but the detailed experiment is part of Martel’s broader series on reconstructing legacy systems with AI. Encarta itself was not the software target. The experiment examined LHA’s -lh5- compression method, described as LZSS with an 8 KB window followed by static Huffman coding. Martel says it was a useful target because the original could answer queries as an oracle, an algorithmic answer key was available, and compressed output could differ even when it decompressed to the same data.

As an Amazon Associate I earn from qualifying purchases.

Martel describes working without the target’s specification or source code: the reconstruction could query an oracle about outputs, while the original source was kept back as a grading key until the reconstruction was frozen. The article names Gemini 3.1 Pro for the decoder, Codex/GPT-5 for the encoder and a cold-recall baseline, and Claude for the design discussion. These are details reported by Martel, not independently verified model comparisons. DEV Community

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why decoding and encoding produced different scores

The decoder and encoder were tested against different standards of success. A decoder passes a round-trip test when it can recover the original input from compressed data. An encoder can produce a valid compressed file that decodes correctly, yet still fail a byte-for-byte comparison with the original encoder. Compression often permits multiple valid representations of the same input; reproducing one particular representation requires matching the original implementation’s choices, not merely its result.

Evaluation Martel’s reported result What it establishes
Decoder round-trips 19 of 19 tested cases were exact. The decoder recovered the tested inputs. It does not establish correctness for untested inputs or paths.
Trained encoder cases 1 of 12 matched the original byte-for-byte (8.3%). The encoder rarely reproduced the reference’s exact choices on this set; a mismatch alone does not mean the output could not decode.
Held-out encoder cases 5 of 7 matched byte-for-byte (71.4%). This higher score largely reflected cases that did not exercise the difficult compression heuristics, rather than stronger generalization.

All figures are Martel’s reported 2026 results for this experiment, not independent benchmarks. He says the held-out cases were mostly random, incompressible, or trivial inputs, where stored-mode or other simple paths could avoid the encoder’s compression decisions. The trained cases included text, source code, and structured data that did exercise compression. He also reports identical rates on trained-seed and fresh-seed corpora, which he interprets as systematic divergence rather than instance-level overfitting. The practical reading is that byte identity was most likely when the difficult choices were bypassed.

The implementation choices behind the byte mismatches

Huffman code lengths and tie-breaking

Martel identifies Huffman code-length assignment as the sharpest divergence. The reconstruction used canonical assignment; he says the original assigned code lengths in heap-extraction order, with equal-frequency ties determined by the precise sift-down comparisons. Different tie outcomes can change code lengths for symbols with the same frequency, and that change cascades through the compressed bitstream. The reconstruction localized this issue but did not reproduce the original sift order.

Choices it got right, and hidden paths it did not test

In the article’s comparison with the unsealed source and the committed prior record, Martel says the reconstruction inferred nearest-offset tie-breaking and one-step lazy matching correctly. It did not model a match-finder chain cap, but that hidden detail was not exposed by the tested inputs. Block splitting at a 32 KB buffer threshold was also not triggered. Because the corpus reached only 8 KB, these are untested behaviors—not observed failures or evidence that the implementation handled those boundaries correctly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What this case says about evaluating AI-generated code

Choose the correctness criterion before scoring

Round-trip validity and exact output identity answer different questions. For a decoder, test whether the recovered data is correct. For an encoder, decide whether any valid representation is acceptable or whether compatibility requires byte-for-byte reproduction of a particular implementation. A single pass/fail score can obscure that distinction.

Build tests that trigger the hard behavior

Input variety matters less than whether inputs exercise the paths under evaluation. Random or incompressible data may be useful for other checks, but in this experiment it often let the encoder avoid compression heuristics. Include realistic compressible data, structured patterns, boundary-sized inputs, and cases designed to force competing matches or frequency ties. Passing an oracle suite only establishes behavior on its sampled cases; an untriggered branch can remain wrong without producing a failing test.

Freeze the implementation before checking the answer key

Martel describes using a tagged commit, sealed source, and manifest check before unsealing the original. Those safeguards make it harder to adjust a reconstruction after seeing the expected implementation and then mistake that adjustment for a successful prediction. The same principle applies to any blind reconstruction or reverse-engineering evaluation: record what was tested and lock the candidate before revealing the reference.

Separate recall from inference

If the question is whether a model inferred a behavior through queries or already knew it, record the model’s prior account before the experiment begins. Martel included a committed cold-recall record for that purpose, while noting a limitation: the encoder and recall record came from the same model, leaving a theoretical shared-prior concern.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

The limit of the conclusion

This is one author-reported experiment, not an industry-wide failure rate for AI-written code, and the account has not been independently reproduced here. Its useful conclusion is bounded: in this reconstruction, the decoder succeeded on the tested round-trips, while exact encoder output usually diverged on cases that exercised compression behavior. The test corpus also left some paths—such as the 32 KB split threshold—unexamined.

“A strong oracle over a narrow corpus hides exactly the mechanisms your corpus never triggers, and it hides them silently, because everything it can see is green.”

— Jean-Luc Martel, discussing the experiment’s oracle and input coverage

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.