Skip to content

Moonshot: commit the generator of token_map_coverage.csv - #78

Merged
SamMausberg merged 3 commits into
mainfrom
moonshot/token-map-coverage
Oct 1, 2026
Merged

SamMausberg merged 3 commits into
mainfrom
moonshot/token-map-coverage

Conversation

@SamMausberg

@SamMausberg SamMausberg commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Fixes the provenance of evidence/moonshot/token_map_coverage.csv, which Codex flagged on #71
(app_register.tex:58). The register cites experiments/moonshot/build_token_map.py, but that
script cannot produce the CSV: it holds out its own calibration split, pads maps to fixed sizes
and writes token_map_report.json. The CSV was made by running bench's bench.token_map coverage over bench's tune maps on the confirm-split plain sweep.

Changes

  • experiments/moonshot/token_map_coverage.py: the generator. It evaluates the four tune maps
    (4,096 / 8,192 / 16,384 / 22,936 rows, unpadded) on the 171,968 output tokens of
    ~/vp-data/moonshot/sweeps/plain/20260930-200640 with bench's token counting.
  • evidence/moonshot/token_map_coverage.csv: regenerated by the script. The values are
    unchanged (0.8912 / 0.9327 / 0.9635 / 0.9754). The source field is now quoted, because the
    old file had an unquoted comma in it, so each row parsed as six fields.
  • evidence/moonshot/README.md: new section 2f with the table, a note that
    build_token_map.py did not produce it, and the command in Section 4.

The 16,384-row coverage rounds to 96.3% (exact share 0.96345), not the 96.4% in #71.

Command

source scripts/sglang_env.sh
python experiments/moonshot/token_map_coverage.py \
  ~/vp-data/moonshot/sweeps/plain/20260930-200640 \
  --out evidence/moonshot/token_map_coverage.csv

Testing

  • Rerunning the command reproduces every value in the committed CSV, and the only
    difference is the quoting. It also runs from outside the repository without PYTHONPATH,
    because the script puts the repository root on sys.path. It runs on CPU and needs the tokenizer and the sweep run directory.
  • pre-commit run on the changed files passes.

experiments/moonshot/token_map_coverage.py evaluates bench's tune maps, unpadded, on the
confirm-split plain sweep with bench's own token counting; it reproduces the committed
values exactly. The CSV is rewritten by the script, which quotes the source field (the
old file had an unquoted comma in it). README 2f holds the table and says that
build_token_map.py did not produce it; Section 4 has the command.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T04:06:43.945305Z c751854 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES

Reviewed head c751854: one commit adding the generator of evidence/moonshot/token_map_coverage.csv.

Checked and correct

  • The generator reproduces the CSV. experiments/moonshot/token_map_coverage.py evaluates bench's tune maps, unpadded, on the plain confirm sweep. With the repository root on the path, rerunning it on ~/vp-data/moonshot/sweeps/plain/20260930-200640 writes a file identical to the committed CSV.
  • Quoting. The CSV now quotes the comma-containing source_run, so each row parses as five fields.
  • The 16,384-row value. The exact share is 0.963453, so README 2f's 96.3% is right. My approval of Appendix E: integrate the moonshot phase-3 results (#60) #71 said 0.9635 "rounds to 96.4"; that was wrong, because I rounded the CSV's four-decimal value rather than the exact share. The appendix should read 96.3%.
  • The README. It says build_token_map.py did not produce this table and puts the command in Section 4.

Blocking

B1. The documented command fails as written (README Section 4; the script's docstring).

  • From the repository root, python experiments/moonshot/token_map_coverage.py ... fails with ModuleNotFoundError: No module named 'bench'. Python puts the script's own directory on sys.path, not the repository root.
  • Fix: do one of these:
    • insert the repository root into sys.path at the top of the script (the other moonshot scripts insert their own directory);
    • document the command as PYTHONPATH=. python experiments/moonshot/token_map_coverage.py ...;
    • run it as a module.

Codex was still running on c751854 when I posted. I'll check its comments with the fix.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c751854c2f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

decimals. Coverage bounds how often a truncated draft head can still propose the target's
token. The
`hot23k` lever uses the 22,936-row map. The CSV comes from
`experiments/moonshot/token_map_coverage.py` (command in Section 4), which uses bench's

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the evidence register to cite this generator

The canonical evidence entry in paper/sections/app_register.tex:60 still says that token_map_coverage.csv was produced by experiments/moonshot/build_token_map.py. That script generates different, padded maps and writes token_map_report.json, so readers following the paper's \ev{token-map} provenance still cannot reproduce this CSV despite the new explanation here; update the register to name token_map_coverage.py.

Useful? React with 👍 / 👎.

Comment on lines +274 to +275
Percentages are rounded from the exact shares (16,384 rows: 0.96345), not from the CSV's four
decimals. Coverage bounds how often a truncated draft head can still propose the target's

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Correct the paper's rounded coverage value

The newly documented exact share rounds to 96.3%, but paper/sections/app_stack.tex:202 still reports 96.4% for the 16,384-row map. Consequently the paper continues publishing a value contradicted by this added precision; update that claim when recording the corrected rounding.

Useful? React with 👍 / 👎.

parser.add_argument('run', type=Path, help='sweep run directory with the confirm outputs')
parser.add_argument('--maps', nargs='+', default=DEFAULT_MAPS)
parser.add_argument('--map-dir', type=Path, default=MAPS)
parser.add_argument('--source', default=SOURCE, help='description written to the CSV')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Derive the source label from the supplied run

When this generator is run on any directory other than the historical confirm sweep without also passing --source, the counts come from the supplied run but every CSV row is still labeled as the fixed mixed-v2 confirm run. This silently misattributes regenerated experimental evidence; default the label from the run path or its manifest, or require an explicit source label.

Useful? React with 👍 / 👎.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES

Re-reviewed head c694d9c. B1 is fixed: the script puts the repository root on sys.path. Run from /tmp with PYTHONPATH unset, it writes a CSV identical to the committed one. Pre-commit is clean.

Codex left three P2 comments on c751854.

Blocking (Codex P2, token_map_coverage.py).

  • The CSV's source_run defaults to the fixed label "mixed-v2 confirm plain sweep ..." whatever run directory is passed. Rerunning on another sweep without --source would mislabel the evidence.
  • Fix: derive the label from the run's sweep.json or manifest (workload, concurrencies, OSL), or require --source when the run is not the default directory.

Paper follow-ups (the other two P2s, for the appendix editor once this merges).

  • paper/sections/app_register.tex:60 should name experiments/moonshot/token_map_coverage.py as the producer of token_map_coverage.csv.
  • paper/sections/app_stack.tex:202 should read 96.3% for the 16,384-row map (exact share 0.96345), not 96.4%.
  • These live in the paper, so they don't block this evidence PR. I'm routing them to the appendix editor.

The label is built from the workload file, sweep label, concurrencies and OSL; a run
without sweep.json needs --source. The committed CSV is reproduced byte for byte.
@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE

Re-reviewed head 210213c. All blocking items in this PR are fixed.

  • B1. Run from /tmp with PYTHONPATH unset, the documented command writes a CSV identical to the committed token_map_coverage.csv.
  • Codex P2 (source label). source_run is now built from the run's sweep.json: workload, label, concurrencies, and OSL or natural stopping. --source overrides it, and a directory without sweep.json exits with "has no sweep.json; pass --source to describe it", which I checked on an empty directory. On the confirm run the derived label equals the committed one, and the CSV is still identical.
  • Checks. Pre-commit is clean, and there are no new Codex comments after c751854.

The two paper-side Codex P2s are routed to the appendix editor for a follow-up PR after this merges: the register should name this generator, and the coverage value should read 96.3%.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant