Skip to content

Write the cross-entropy definition with surprisalunderf - #302

Merged
d-morrison merged 1 commit into
mainfrom
claude/project-thread-7ymiow
Oct 31, 2026
Merged

d-morrison merged 1 commit into
mainfrom
claude/project-thread-7ymiow

Conversation

@d-morrison

Copy link
Copy Markdown
Contributor

Ezra's review comment on pds#300 asked for the surprisal macro instead of typed parentheses. macros#325 merged \surprisalunderf{q}{x} (s_q(x)).

This PR bumps the latex-macros pin to that merge (9e19dbe) and rewrites the two uses in _subfiles/_def-cross-entropy.qmd: the definition of the surprisal measured by q, and the defining equation of cross-entropy.

The prose symbol $\surprisal_q$ in the sentence introducing the definition stays, since it names the symbol without an argument.


Generated by Claude Code

…underf

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9mmEbJ5cfXnwuhpxdh
@github-actions

Copy link
Copy Markdown
Contributor

Claude finished review — View run


The change looks correct. I only read the diff and the macro source; I did not render the page.

Findings

_subfiles/_def-cross-entropy.qmd:11 (suggestion, not blocking).

  • This line still writes $\surprisal_q$ as a raw subscript.
  • Lines 12 and 14 now use \surprisalunderf{q}{x}.
  • So the definition ends up with two spellings of the same quantity.
  • The unchanged line is outside the diff, but the macro rule (3) says to use the macro where it names the quantity.
  • There is no bare-name macro for \surprisal_q without an argument. I only checked \surprisalunderf, not whether another one exists. If none does, the line can stay. Otherwise, suggest adding one to Morrison-Lab/macros.
  • Alternatively, reword to ... the surprisal $\surprisalunderf{q}{x}$ measured by $q$.

Checks that passed

  • Macro exists in the pinned submodule. The submodule bump to 9e19dbe ("Add \surprisalunderf for the surprisal measured by a named distribution (#325)") defines \surprisalunderf at latex-macros/macros.qmd:1458. It is \providecommand{\surprisalunderf}[2]{{\surprisal_{#1}\paren{#2}}}. It takes two arguments, and the call sites pass two. The macro renders the same output as the old \surprisal_q\paren{x}.
  • Hand-typed \paren. The old \surprisal_q\paren{...} was a hand-typed paren around a macro argument (rule 6). The swap fixes it.
  • Macro status. The macro appears in interpretations.tsv and is neither an alias nor deprecated.
  • No other uses in the repo. _subfiles and the top-level pages have no other \surprisal_q.
  • No CI-sensitive changes. The PR touches no bibliography, wordlist, workflow, or build-artifact files.
  • No new prose to check. The line-break and definition-div rules have nothing to flag, since the only changes are in math.

Verdict

Ready for merge. The suggestion on line 11 is optional.

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "bc00f2a5d0be72b36a80b4eeaa1349d7825a1a71",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "The changed lines in _subfiles/_def-cross-entropy.qmd correctly use \\surprisalunderf, which the bumped latex-macros submodule defines with two arguments. The only leftover is an unchanged raw \\surprisal_q on line 11, noted as an optional suggestion.",
  "holistic_assessment": "The change is scoped to one macro adoption plus the submodule bump that supplies it, with no effect on anchors, build artifacts, bibliography, or CI. No regression risk was found."
}

I fetched PR #302 live just now. It is open and unmerged, and its head is still bc00f2a5d0be72b36a80b4eeaa1349d7825a1a71, the commit I reviewed.

The review above therefore still applies. \surprisalunderf is defined in the pinned submodule with two arguments. The only leftover is the unchanged raw \surprisal_q on line 11 of _subfiles/_def-cross-entropy.qmd, which is an optional suggestion.

Verdict

Ready for merge.

Stopping Point: Clean stopping point reached --- session done; UMS executed; no follow-up items pending

Reviewed commit: bc00f2a

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $0.2232 (review) — run

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.

2026-10-31 14:22 UTC

@d-morrison
d-morrison merged commit 7537ca6 into main Oct 31, 2026
36 checks passed
@d-morrison
d-morrison deleted the claude/project-thread-7ymiow branch October 31, 2026 14:22
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.

2 participants