Skip to content

head_geometry README: cite the committed evidence for the Hopper model and row invariance - #169

Merged
SamMausberg merged 3 commits into
mainfrom
paper/geometry-hopper-evidence
Oct 2, 2026
Merged

SamMausberg merged 3 commits into
mainfrom
paper/geometry-hopper-evidence

Conversation

@SamMausberg

@SamMausberg SamMausberg commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

evidence/head_geometry/README.md still called two stock-kernel facts pending "the kernel workstream's evidence". Both have been committed since, in evidence/certified_head/stock_invariance.json (register entries kernel-error and kernel-invariance in the paper), so the README now cites them.

What changed (README only, no numbers regenerated):

  • Hopper model (the summary at line 46, and the two gamma tables at lines 342 and 356). "Pending its evidence" is replaced by what the evidence shows: over 2,048 real head inputs, the largest accumulation error of the stock GEMM's FP32-output variant is 2.07e-6 of sum_j |w_ij h_j|, which is 1/58 of the Hopper bound (fp32_output_error.max_rel_to_sum_abs / model_hopper_wgmma = 1.1922e-4 / 2.07e-6 = 57.6). The model stays an assumption for the kernel the engine runs, because the BF16-output kernel does not expose its accumulator. The README says so, as the paper does (Table 1 and Section 7).
  • Row invariance (the paragraph after the gamma tables, line 378). "Whether it is on this stack is pending" is replaced by the measured property: on this build, at 20 batch sizes from 1 to 256, every row's logits equal its logits at batch 1 (batches.*.rows_equal_to_m1_*, all true). That is a one-off measurement, not a guarantee. The paragraph now also says that the certified head's column fallback needs a different property. The fallback reruns the stock GEMM at the same batch shape over the gathered candidate rows, so it relies on column-subset invariance. The same file measures that property twice: for 64 random head rows (column_subset_equal, an M x 64 product) and at the fallback's own shape of 64 gathered rows per batch row (gathered_candidates_equal, M x 64M), all true. cuBLAS picks its kernel by shape, so the second check is the one the fallback relies on, and it is the one column_invariance_self_test re-checks at the deployed batch sizes. The self-test does not check row invariance (Codex's P2, fixed in 1179efc; the gathered shape is the reviewer's point, fixed in 58387d1). The paragraph also points to micro_head.json for the cost of the two fallbacks the certified head implements (whole-batch and column), which this directory does not measure, and says that resolving rows one at a time is neither implemented nor timed.

The task named lines 342 and 356. Lines 46 and 378 had the same stale "pending" and are fixed in the same commit. No other "pending" remains in the file.

Checks: pre-commit on the file (the host-identity guard passed; the other hooks skip evidence/); codespell run on the file by hand. No paper source changes, so no build.

Review. Codex at 0ae2d29, one P2: the first version said the start-up self-test re-checks row invariance. It checks only column-subset equality at the same batch shape (CertifiedHead.column_invariance_self_test). Fixed in 1179efc, and the thread has a reply. Reviewer at 1179efc (REQUEST CHANGES): the column fallback's shape is gathered_candidates_equal, not column_subset_equal; optional items were to name the timed fallbacks and to add the BF16-output caveat to the summary at line 47. All three are fixed in 58387d1.

…e Hopper model and row invariance

The README still called the Hopper model's justification and the stock GEMM's row
invariance pending the kernel workstream. Both are committed in
evidence/certified_head/stock_invariance.json: the FP32-output variant's largest error
over 2,048 real head inputs is 1/58 of the Hopper bound (the BF16-output kernel hides its
accumulator, so the model stays an assumption), and rows are bitwise invariant at 20
batch sizes from 1 to 256.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 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-02T01:17:24.640879Z 58387d1 Manual request
ℹ️ 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.

@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: 0ae2d29ebf

ℹ️ 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".

Comment thread evidence/head_geometry/README.md Outdated
Comment on lines +381 to +382
(`evidence/certified_head/stock_invariance.json`); that is a measured property of this
build, which the certified head's start-up self-test re-checks on the deployed shapes, and

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 self-test coverage claim

The start-up test does not re-check row-wise batch invariance: CertifiedHead.column_invariance_self_test keeps the same M-row input and only compares the gathered-column GEMM with those columns of the full GEMM. If a library or kernel change preserved column-subset equality but made a row's result differ between M and M=1, this test would still pass despite the preceding text identifying row invariance as required for one-at-a-time fallback. Distinguish the separately measured row-invariance result from the column-subset property actually checked at start-up, or extend the test to cover both.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in 1179efc. The paragraph now cites each property for what it is: row invariance (every row's logits at 20 batch sizes equal its logits at batch 1, rows_equal_to_m1_* in stock_invariance.json) is a one-off measurement of this build; the column fallback reruns the stock GEMM at the same batch shape over the gathered rows and relies on column-subset invariance, which the same file measures (column_subset_equal) and column_invariance_self_test re-checks at the deployed batch sizes. It also says the self-test does not check row invariance.

…ariance, not row invariance

Codex on #169: column_invariance_self_test compares gathered head rows with the full stock
head at the same batch shape. Row invariance (each row's logits at 20 batch sizes equal
its logits at batch 1) is measured once in stock_invariance.json; the README now cites
each property for what it is and says which one the column fallback relies on.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES at 1179efc

I checked the README against evidence/certified_head/stock_invariance.json, experiments/certified_head/stock_invariance.py, src/certified_head/head.py (column_invariance_self_test, _column_fallback) and micro_head.json on main. The numbers hold: all 20 batch sizes (1 to 256) have rows_equal_to_m1_* = M/M and subsets_equal_* = 6/6 with the flag on and off, column_subset_equal and gathered_candidates_equal are true everywhere, and 1.1922e-4 / 2.0701e-6 = 57.6 (the register's "58 times inside"). The fix at 1179efc answers Codex's P2: row invariance and column-subset invariance are now separate, and the README says the self-test checks only the second. Host-identity grep is clean on the file, the commit log, the PR body and the review comments. Commits are authored and committed by Samuel Mausberg, with no co-author lines.

Blocking

  1. evidence/head_geometry/README.md:386: the README cites the wrong key for the column fallback's shape. column_subset_equal compares one fixed set of 64 random head rows (cols = randperm(v)[:64], an M x 64 GEMM). The column fallback gathers M * min(capacity, COLS_CAP) rows into one GEMM (_column_fallback, M x 64M at the default cap), and cuBLAS chooses its kernel by shape. That shape is what gathered_candidates_equal measures and what column_invariance_self_test re-checks. evidence/certified_head/README.md makes the same distinction ("64 random rows, and M x 64 rows, the column fallback's shape"), and so does the register (kernel-invariance: "including the gathered-candidate shape of the column fallback"). Fix: cite gathered_candidates_equal as the measurement at the fallback's own shape, for example "(column_subset_equal for 64 random rows, gathered_candidates_equal at the fallback's M x 64M shape)".

Optional

  1. README.md:389-390: the paragraph now covers three ways to complete undecided rows: the whole-batch rerun, one row at a time, and the column fallback. "either fallback mode ... times both" is therefore ambiguous. micro_head.json times the whole-batch and column fallbacks. Nothing implements or times one-row-at-a-time resolution. Naming the two modes ("the whole-batch and column fallbacks") would remove the ambiguity.
  2. README.md:47: the summary bullet gives the 1/58 ratio but not the caveat that line 344 carries (the BF16-output kernel SGLang runs does not expose its accumulator). "assumed" covers it, but a reader who stops at the summary could take the FP32-output measurement as a check of the deployed kernel. Consider adding the clause.
  3. Outside this PR: evidence/certified_head/README.md ends its stock-kernel section with "The invariance is a measured property of this build ... the start-up self-test re-checks it on the deployed shapes". "The invariance" there covers both properties listed above it, so it overstates the self-test in the way Codex flagged here. That belongs in a later kernel-README edit, not this PR.

Codex: the P2 at 0ae2d29 is fixed and has a reply. Codex is running on 1179efc. I'll re-check its result on the next head.

@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: 1179efc8b2

ℹ️ 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".

Comment thread evidence/head_geometry/README.md Outdated
same batch shape. The certified head's column fallback needs a different property: it reruns
the stock GEMM at the same batch shape over the gathered candidate rows, so it relies on
column-subset invariance (the gathered rows' logits equal the same columns of the full
stock head). The same file measures that at the 20 sizes (`column_subset_equal`), and the

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 Cite the fallback-shaped invariance measurement

For batch sizes above 1, column_subset_equal only compares a fixed 64-column GEMM, whereas the actual fallback gathers M * 64 rows and may select a different kernel; that exact shape is recorded separately as gathered_candidates_equal in stock_invariance.py. As written, the cited field does not support the assertion about gathered candidate rows, so cite gathered_candidates_equal instead.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in 58387d1: the README now cites gathered_candidates_equal, which compares the M x 64M gathered-candidate GEMM with the matching rows of the full GEMM. That is the fallback's shape and the property column_invariance_self_test re-checks. column_subset_equal is described separately as the fixed 64-row check.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in 58387d1: the paragraph now cites gathered_candidates_equal (the fallback's M x 64M shape, which column_invariance_self_test re-checks) beside column_subset_equal (64 random rows).

…tes_equal), name the timed fallbacks

Reviewer on #169: column_subset_equal checks one set of 64 random head rows, an M x 64
product; the column fallback gathers 64 rows per batch row (M x 64M), which
gathered_candidates_equal measures and the start-up self-test re-checks. Also names the
two fallbacks micro_head.json times and adds the BF16-output caveat to the summary.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 58387d1f2a

ℹ️ 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".

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE at 58387d1

The delta 1179efc..58387d1 fixes the blocking item and both optional README items from my review at 1179efc:

  • evidence/head_geometry/README.md:387-393 cites both column checks: column_subset_equal (64 random head rows, M x 64) and gathered_candidates_equal (the fallback's M x 64M shape). It names the second as the one the fallback needs and the self-test re-checks. That matches experiments/certified_head/stock_invariance.py (gathered = randint(0, v, (m * 64,))) and column_invariance_self_test (m * min(capacity, COLS_CAP) gathered rows).
  • Lines 393-395 name the two fallbacks that micro_head.json times (certified_fallback, certified_columns_fallback, and the expected-time table in evidence/certified_head/README.md). They also say that one-row-at-a-time resolution is neither implemented nor timed.
  • Line 47 now carries the BF16-output accumulator caveat.

Unchanged from my earlier check: every number traces to evidence/certified_head/stock_invariance.json (20/20 sizes, every invariance flag true, 1.1922e-4 / 2.0701e-6 = 57.6). Host-identity grep is clean on the file, the commit log and the PR body. Commits are authored and committed by Samuel Mausberg, with no co-author lines. No "pending" remains in the file.

Codex: the P2 at 0ae2d29 is fixed and has a reply. The P2 at 1179efc (the fallback shape, the same point as my item) is fixed in 58387d1, and Codex found no major issues on 58387d1.

Optional, not blocking: the Codex thread at 1179efc (comment 4162018886) has no reply yet. A one-line "fixed in 58387d1" there would keep the record complete.

Not run: pre-commit and codespell, because a timed exclusive hold was running. The change is README-only under evidence/, where only the host-identity hook applies, and I checked that by grep.

@SamMausberg
SamMausberg merged commit 2367122 into main Oct 2, 2026
SamMausberg added a commit that referenced this pull request Oct 2, 2026
Review of 84ffb44. H4's derived 3.4-3.5% uses the W8A16 pass at
0.66-0.67 of the stock head at M = 1 (setup.tex), not the best-mode
column in H3, which includes W8A8 timed on the earlier TMA tiles; both
cells now say which mode they use. P3's 33-44% is scoped to replay 1
(24-35% on replay 2), the frontier's 1.9% is called a coefficient of
variation, and hostgap's token-identical outputs say logprobs were not
compared. The in-flight section and the agent-dependent rows move to
01:30 UTC: s1 and s2 done, #167's timing running, the first served
certified-head hold queued after s3, #169 merged, #171 and #172 open,
and the paper, state, profile and redteam work active.

The commit skips the hook because a timed hold is running; pre-commit
on this staged file is queued in the CPU window.
SamMausberg added a commit that referenced this pull request Oct 2, 2026
Brings #169's head_geometry README into the tree, so the task list's
done item for #169 matches the branch. TASKS.md is unchanged.
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