Ship the learned-key pipeline, without which six figures cannot be rebuilt

The package was missing every script behind the KM (lrn.) curves and
both learned table rows: exp_learned's driver, the merge that folds the
learned rows into sec_compare.csv and refresh_summary.csv, and the
report that reads the learned numbers back. It was also missing
sec_keylen_perm.csv, so Fig. 3 could not be regenerated at all, and the
two diagnostics that answer why a fixed key beats a learned one here and
where a learned mask would win instead.

The learned artifacts themselves are regenerated. They were trained on
the cross-entropy alone, which drifts to disjoint sparse supports: 99
percent of each key's energy on about six of the 64 entries, so a digit
is decided over a sixth of its period and the key set is a choice of
support rather than a dense direction in R^L. They are now the
regularized keys of Section V-C, and check_consistency asserts which of
the two families the figures draw.

Verified from inside this repository: replot_security.py rebuilds all
seven result figures, make_tables.py reproduces both result tables, and
check_consistency.py passes every check that does not need the
manuscript.

The README now lists what ships. Its run list, layout and figure map had
none of the learned pipeline, named two tables the manuscript renders as
prose, and gave Fig. 3 no data file for its permutation curve.
This commit is contained in:
KiHoLee
2026-08-28 23:58:01 +09:00
parent ffe56b4b25
commit 138897aa8d
35 changed files with 853 additions and 168 deletions
+28
View File
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
"""Regenerate every learned-key artifact under the regularized loss.
learned_model now trains under the two penalties of Section V-C, so
every *_learned file has to be rebuilt from it. sens runs before brute
because brute re-reads the sensitivity sweep it produced.
"""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
import exp_learned as E
import exp_full as F
# stage_N is Fig. 2's learned SNR sweep and lives in exp_full, so it is
# named here rather than in exp_learned's own list
STAGES = [F.stage_N, E.keylen, E.jamming, E.kpa, E.refresh, E.compare,
E.sens, E.brute, E.real]
if __name__ == "__main__":
only = sys.argv[1:]
for fn in STAGES:
if only and fn.__name__ not in only:
continue
print("=" * 60)
print("stage", fn.__name__, flush=True)
fn()
print("[done] every learned artifact rebuilt")