Repository navigation
fix(repl): check asks the plan judge and twelve forgeries fail - #326
Merged
Merged
Conversation
the-homeless-god
force-pushed
the
a/check-asks-the-plan-judge
branch
from
October 7, 2026 21:00
24f4b12 to
590743d
Compare
The rules over the `plan` declaration ("Proverka planov" in
flang/self/io.flang) have been printed into the seed and are called from
"Proverit svyazannoe", but `flang check` does not take that road: it
repeats the sequence in `repl_check_sources`, and the plan call was
missing from it. A quiet call is now there, next to the one for
processes; one insertion covers five commands that share the road -- the
shell (`repl_check`), `check`, `proof`, `emit` and `package`.
Measured 4 October 2026, trunk 4d76abd, both binaries built in one
working copy, seed md5 63150ae8, patched md5 817cbea2:
* fourteen samples flang/test/fixtures/plany, two judges of one
binary: `check` accepted twelve forgeries with code 0 and the same
first line as the whole sample 00; now it rejects all twelve with
code 1 and a named FLANG_PLAN. `test` rejected all twelve before and
after. Sample 00 stays code 0, sample 13 answers one type-check
remark.
* probe plan-rules-asked: 29 probes, 12 diverged, code 1 before; 29
probes, 0 diverged, code 0 after.
* negative control: 278 tree programs declaring `plan`, each run under
`check --bystro` by both binaries. Code 4: 259 -> 247. Code 1:
18 -> 30. One file (flang/self/bootstrap/emit-from-source.flang)
answers neither binary within 150 s and is NOT measured. The
difference between the binaries is exactly the twelve forgeries,
4 -> 1 with FLANG_PLAN; no other file changed its answer.
The PROVERENO line of `--bystro` named processes and not plans while the
`plans` surface already stood among the judged keys, so neither "not
judged at all" nor "not checked to the end" was printed about plans --
the binary claimed it had checked. That line now names plans too.
The probe gets a CI job of its own rather than a step among the guards.
The fix lives in the tree shell, and bootstrap/flang is built from the
seed copy of that shell, so a probe on bootstrap/flang would measure the
seed, not the tree. The job therefore builds a second binary by the same
recipe that seed-runtime-is-source verifies -- seed header plus source
verbatim -- which reproduces md5 817cbea2 exactly and carries the seed's
own limit stamp, since bootstrap/flang_runtime.h is copied byte for byte
(FL_MAX_DEPTH 20000, FL_MAX_STEPS 4000000000000, not the runtime
defaults). Build cost measured here: 300 s at -j4 without -flto,
2.65 GiB peak, which does not fit the 20-minute guards job.
The job's first step is a forgery, because a probe that cannot redden is
indistinguishable from a fixed tree. It breaks the NAME in the quiet
call rather than deleting the call: repl_call then answers
FLANG_UNKNOWN_NAME, that one refusal is swallowed on purpose, and the
binary behaves exactly as it did before the fix -- so the suite reddens
on its own subject and not on a broken build. Measured: forged 29
probes, 12 diverged, code 1; honest 29 probes, 0 diverged, code 0. The
honest binary is a 6.5 s relink, since the expensive compiler_flang.o is
already there.
Reprinting the self-hosted part is NOT needed: bootstrap/compiler_flang.c
already carries the rules and their call. What IS needed is a fresh
fingerprint once the seed copy catches up, and `seed-refresh --plan
Check` says so itself: "only copied files touched -- a fast reseed is
enough".
The quiet call of the plan judge in repl_check_sources keeps its code and loses the comment block, and the plan-rules-asked job in binary.yml is rewritten without comments and with English shell variable names. Tasks 7706 and 8398 are done by this branch and leave the tree. Measured here: the probe plan-rules-asked on a binary built from the seed header plus this source answers 29 probes, 0 apart, exit 0; with the judge name forged it exits 1 on the twelve check rows; the seed binary stays red until the shell is reseeded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PNHrA3rG7FTWhB11E7pjDQ
The plan judge call adds 17 lines to flang/src/emit/c/flang_repl.c, so the two C line counts in docs/tree-inventory.md move with it. The CI step names the probe file literally, so the run-verdict guard sees the target by name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PNHrA3rG7FTWhB11E7pjDQ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PNHrA3rG7FTWhB11E7pjDQ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PNHrA3rG7FTWhB11E7pjDQ
the-homeless-god
force-pushed
the
a/check-asks-the-plan-judge
branch
from
October 8, 2026 14:09
590743d to
5b2c094
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Беда, проверенная мной лично
Один и тот же файл, двоичный ствола:
checkговорит «замечаний нет» о программе, которуюtestотвергает названным отказом. И это хуже отсутствующего правила: поверхностьplansуже стоит среди судимых, поэтомуcheckне сказал ни «не судит вовсе», ни «сверено не до конца» — он утверждал, что сверил. Та же порода, что у процессов (задача 7101, заметкаdocs/zettel/a-rule-inside-the-binary-is-not-a-rule-the-binary-asks.md).Правила СУЩЕСТВОВАЛИ в двоичном и ехали в семя — но
flang checkидёт не через«Проверить связанное», а повторяет её путь вызов за вызовом, и вызова планов в этом пути не было.Починка
Тихий вызов судьи планов в
repl_check_sources(flang/src/emit/c/flang_repl.c) рядом с вызовом процессов. Одна вставка закрывает пять команд:repl_check,check,proof,emit,package. ОтказFLANG_UNKNOWN_NAMEглотается нарочно (старое семя функции не несёт), любой другой — беда вслух.Чем доказано — прогоны
Собрал семя законным рецептом (шапка 9 строк + источник дословно) и двоичный: md5
817cbea2. На нём:Сообщения совпадают с
expected.tsvзнак в знак («план «Работа» объявлен дважды», «не собран: в программе нет сумм «Отклик»», «состояние плана — неизвестный тип «Хода»» и так далее).Отрицательный контроль на всём дереве: 278 программ с «план», два двоичных,
check --быстро. Ответ сменили ровно 12 файлов — ни одна верная программа не задета. Один файл (flang/self/bootstrap/emit-from-source.flang) не ответил ни одному двоичному за 150 с — он не мерен, и зелёным не считается.Проба в CI с подлогом (работа
plany): шаг 1 сбивает ИМЯ судьи в тихом вызове — набор обязан дать «разошлось 12», код 1; шаг 2 начисто — «разошлось 0», код 0. Оба шага прогнаны дословно из YAML локально.Что требуется после слияния — и чего НЕ требуется
Полная перепечатка не нужна: правка только в копируемой части. Приборы говорят это сами:
--teloкод 0 («тело семени сошлось, файлов 7»),seed-refreshкод 0 («тронуты только копируемые файлы — быстрый пересев достаточен»),--bystroкод 1 («flang_repl.cизменён после перепечатки»). Нужен быстрый пересевseed:refresh— минуты. Он нарочно не сделан в этой ветке: он перезаписываетscripts/seed-fingerprint, а сейчас идёт партия печати, и два отпечатка на одном файле дали бы конфликт.Пока пересева нет, ярлык
plan-rules:probeчестно красен («проб 29, разошлось 12») — это правда о семени, которое судью планов ещё не спрашивает, а не поломка.Перемеренные числа задач
Три числа в задачах 7706 и 8398 оказались устаревшими и исправлены: программ дерева с «план» 278 (а не 268), кодов 1 у нынешнего двоичного 18 (а не 3; 15 новых —
FLANG_IMPORT_AMBIGUOUSв примерах, к планам отношения не имеет), и «перепечатка не нужна» верно о печатаемой части, но неверно об отпечатке.Заслон перед пушем: 21 проверка из 21 зелены за 59 с.