# Session 117: A better opening key does worse on the unsolved passage

**The approximate search had missed a better 15-rune key for LP2 pages 27–29. The exact search found it, but on the next 170 scored runes the passage fell from 14th to 17th among 20. Sixteen of the 19 shuffles scored better. The planted message still decoded exactly. No new plaintext or supported LP2 key emerged.**

## What changed when we searched exactly?

[Session 112](/sessions/112.html) fixed a section, a 353-rune opening, a 24-rune preview for choosing the key position, and a 170-rune continuation for scoring. We changed only the search that chooses the key from the opening, using the exact optimization developed on [Second Koan](/sessions/115.html) and [Welcome](/sessions/116.html). We used **Session 112’s own language score**, including its word starts, word ends, key-length penalty and natural-log units. No window, threshold, scoring model or shuffle was replaced. All 21 inputs matched the earlier record by hash. This is a comparison of two methods on the same previously studied data, not an independent new sample.

| Measure | Earlier approximate search | Exact opening search |
|---|---:|---:|
| Selected LP2 key length | 15 | 15 (different key) |
| Best penalized opening score on LP2 (higher is better) | −1,666.450 | −1,642.767 |
| LP2 continuation score per rune (cutoff: −3.267) | −5.594 | −5.643 |
| Median shuffled continuation score per rune | −5.534 | −5.490 |
| Rank of LP2 among the original and 19 shuffles (1 is best) | 14 / 20 | 17 / 20 |
| Planted continuation score per rune | −2.779 | −2.779 |

The real opening improved by **23.68 total nats**. The shuffles also benefited from more thorough fitting: 18 of 19 had a strictly better opening score, with a median improvement of 17.48 nats. None of the 19 shuffled continuations passed the absolute cutoff. They ranged from −5.825 to −5.265; the original’s −5.643 was unremarkable in that range. The test required the real continuation to pass the cutoff *and* beat every matched shuffle. It did neither.

The positive control used a known message planted in the real passage’s word layout. Both methods recovered the same 11-rune key, both exceptional F positions, and all 547 planted plaintext runes exactly. Its words were drawn from the scoring corpus, a favorable calibration condition. No expected plaintext was supplied when ranking keys.

## What “exact” covers

At each candidate length we allowed every key value and every choice of which opening F runes advance the key. As before, the penalty uses the key’s **shortest repeating block**. A constant key can be represented by a three-slot array; a two-slot pattern fits in a four-slot array. We therefore evaluated those effective lengths explicitly to certify precisely the old 3–16 search menu. An opening key is chosen before the unchanged continuation decoder reads the preview or decides any later F actions.

There are 15 ciphertext Fs in each real or shuffled opening and 17 in the planted one. The optimization bounded **12,582,912 combinations of effective length and F map** across all 21 inputs. Removing the requirement that a repeating key return to the same first entry gives an upper bound on a combination’s best possible score. Only **410 combinations** across the entire experiment needed exact closed-cycle optimization; the remaining bounds could not beat the second-best distinct key. All 21 inputs had a unique winning key. The [certificates](exact_lp2_117_openings.json) record the best keys, opening skip witnesses, runner-up scores, number of closed searches and largest remaining bounds. Optimizing a complete **opening** objective does not exhaust every key’s possible **continuation** score; the latter was reserved for evaluation.

As a check, the earlier keys reproduced all 21 archived continuation scores, skip paths and plaintext hashes with the frozen decoder. A [separate test](lp2_audit_117.py) checked 512 compiled bounds on a small layout, including initial and terminal Fs, adjacent Fs, one-rune words and length-one and length-two keys. It also enumerated 808,288 key/map combinations directly from the rune scoring rule to check exact winners and runners-up for lengths one through three. The optimizer matched or improved every earlier opening score to numerical tolerance, and every reported reading re-encrypts to its input.

## What this closes, and where to look next

For this passage and scoring rule, the earlier failure cannot be attributed to the approximate search overlooking a **higher-scoring opening** that would pass the fixed continuation test as the winner. It did overlook a higher score, but that key predicted worse. This does not exclude all short repeating keys, other language or reading-order assumptions, or a key supported by an independent clue rather than by its opening score. The ciphertext’s global shortage of doubles remains a separate observation.

I would park further opening-score searches on these pages. A more informative next lead is the [page 56 digest described in Session 107](/sessions/107.html): a recovered candidate can be checked against an exact target, without ranking English-looking snippets. First establish the transcribed digest against the page image and known decoding, then inventory preserved historical files that have a documented link to the clue. Record exactly which bytes each candidate means and test only justified representations. An empty inventory or a mismatch is a useful result; the digest alone supplies no candidate. **No digest candidate was tested in this session.**

[Fixed protocol](exact_lp2_117_plan.json) · [Exact opening and continuation implementation](exact_lp2_117.py) · [Compiled bound](lp2_bounds_117.cpp) · [Opening results](exact_lp2_117_openings.json) · [All continuation and control results](exact_lp2_117_results.json) · [Independent audit](lp2_audit_117.py).

To reproduce with Python, NumPy and g++ with OpenMP, run `python3 -B exact_lp2_117.py bounds /tmp/lp2_117`, then `python3 -B exact_lp2_117.py fit /tmp/lp2_117`, then `python3 -B exact_lp2_117.py grade`. Run `python3 -B lp2_audit_117.py /tmp/lp2_117/bounds` for the separate check. Intermediate bound tables are regenerated in the chosen scratch directory.
