mirror of
https://github.com/hanzoai/papers.git
synced 2026-10-22 17:20:17 +00:00
`make -k all` returned 0 over any number of broken papers, so CI was green the
whole time it existed. Four things had to be true for that:
- every recipe line ended in `|| true` and the rule printed "FAIL" instead of
exiting, so make never saw a failure;
- nonstopmode emits a PDF for almost any input, so "the PDF exists" is not
the same question as "the paper compiled" — zen-nano_whitepaper produced
one through 23 LaTeX errors;
- pdfs/ was tracked, so a checkout handed the "check every paper came out"
step 100 of the PDFs it was about to look for;
- discovery was three wildcards, so 69 of the repo's 219 papers were
compiled by nothing at all, defense/ by a second copy of the same
swallowing loop written inline in ci.yml.
The rule is now one latexmk per paper and its exit status is the gate:
-halt-on-error (no PDF from a broken paper), -bibtex (a declared bibliography
must resolve rather than being skipped when the .bib is absent), -Werror (an
undefined citation is a defect, not a log note), -cd (each paper compiles from
its own directory, so zen/ finds references.bib and defense/ finds
hanzo-defense.sty). .DELETE_ON_ERROR so a failed run leaves nothing behind,
and pdfs/ is untracked because it is output.
Run against the tree it was guarding, the honest gate fails 24 papers:
6 \begin{itemize} with its backslash-b eaten, leaving a bare `egin{itemize}`
and no \end — artist, designer-instruct, eco, nano, next, omni
3 the same list with the opener deleted outright, so five \item stood in no
environment — artist-edit, designer-thinking, scribe
4 \and in a cover page's raw \@author: it expands to \end{tabular} and closed
a tabular nothing had opened, and \thanks left hyperref pointing at a
footnote anchor that was never created; plus five stray \end{table} at the
end of those documents — director, foley, musician, video
9 \color{gray} under \usepackage{color}, which defines eight names and not
that one — xcolor is the superset the working papers already load
6 \bibliography{references} naming a database that was never written, so
every citation rendered [?] — zen/references.bib now holds all 27 works
9 \bibliographystyle+\bibliography in papers with no \cite at all — dropped
3 characters pdflatex has no glyph for: CO₂ -> CO\textsubscript{2},
↔ -> $\leftrightarrow$, Persian letters -> their code points, the
SentencePiece marker -> \textvisiblespace
1 \IF{...} \COMMENT{...}: algorithmic's \IF opens a list and the comment
landed in it before any \item; the comment slot is \IF[...]{...}
1 \ref{eq:anchor_update} to an equation the paper never writes
All 219 papers now compile from a clean tree: `make -k all` exits 0.
Co-authored-by: Hanzo Dev <[email protected]>
36 lines
1.1 KiB
Bash
Executable File
36 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
# Regenerate INDEX.md — the catalogue of every standalone paper.
|
|
#
|
|
# The paper set is the Makefile's ALL_TEX, read from `make list`. This script
|
|
# used to re-derive it with its own grep, so the index and the build could
|
|
# disagree about what a paper is; they cannot now.
|
|
#
|
|
# There is no "has a PDF" column any more. Every paper here is built by CI, so
|
|
# the answer is always yes for a run that passed, and the column only ever
|
|
# reported whether a stale artifact happened to be lying in the working tree.
|
|
set -eu
|
|
cd "$(dirname "$0")/.."
|
|
|
|
tmp=$(mktemp)
|
|
make --no-print-directory list > "$tmp"
|
|
|
|
papers=0
|
|
{
|
|
echo '# Hanzo Papers Index'
|
|
echo
|
|
echo 'Auto-generated catalogue of research papers. Regenerate: `scripts/gen-index.sh` (or `make index`).'
|
|
echo
|
|
echo '| Paper | Path |'
|
|
echo '|-------|------|'
|
|
while IFS= read -r tex; do
|
|
slug=$(basename "$tex" .tex)
|
|
[ "$slug" = main ] && slug=$(basename "$(dirname "$tex")")
|
|
papers=$((papers+1))
|
|
printf '| `%s` | `%s` |\n' "$slug" "$tex"
|
|
done < "$tmp"
|
|
echo
|
|
printf '**Total**: %s papers\n' "$papers"
|
|
} > INDEX.md
|
|
rm -f "$tmp"
|
|
echo "INDEX.md: $papers papers"
|