Skip to content

docs(tasks): 8398 has one cause and a probe that reds today - #300

Merged
the-homeless-god merged 3 commits into
devfrom
a/8398-twelve-wrong-programs
Oct 4, 2026
Merged

the-homeless-god merged 3 commits into
devfrom
a/8398-twelve-wrong-programs

Conversation

@the-homeless-god

Copy link
Copy Markdown
Member

Диагноз 8398: причина одна, и она не там, где искали

Двенадцать нарочно сломанных объявлений план получают от
bootstrap/flang check тот же ответ, что и целая программа: «замечаний нет»,
код 0. Воспроизведено на всех двенадцати (двоичный из семени ствола
188e5a6e).

Причина одна на все двенадцать: flang check повторяет дорогу проверки
своим кодом в repl_check_sources (flang/src/emit/c/flang_repl.c), и вызова
«Проверить планы» в этом списке нет — ни одного, и так было с рождения файла
(git log --all -S по нему пуст). Это та же порода, что задача 7101 у
процессов.

Четыре других объяснения сняты замером, по одному на каждое: парсер несёт оба
объявления; правила и их вызов из «Проверить связанное» напечатаны в
bootstrap/compiler_flang.c; связывание поле plans не теряет; сами правила
на всех двенадцати отвечают верно. Решающая улика — ДВА судьи одного двоичного
на одном файле: flang check принимает молча, flang test отвергает кодом 1 и
печатает FLANG_PLAN. flang io без --на-веру — тоже отвергает.

Что в этом PR

docs/tasks/8398-… переписана: разбор с замерами, таблица четырнадцати образцов у двух судей, отрицательный контроль. Исправлены два устаревших утверждения: ждать надо код 1, а не 2 (код 2 — «проверено НЕ ДО КОНЦА»), и «где живёт правка» звало в flang/self/io.flang — оба файла там правы
docs/tasks/7706-… новая задача на саму правку: одна вставка в repl_check_sources. Перепечатка самосборной части НЕ нужна
flang/proof/probes/plan-rules-asked/ новый набор проб: 29 строк, четырнадцать образцов у check и у test
.flangrc короткая команда plan-rules:probe — проба позвана

Проба красна сегодня и зелена, когда причину закроют

Ожидания в expected.tsv СНЯТЫ ЗАМЕРОМ, а не предсказаны: тихий вызов вставлен
в копию дерева ВНЕ репозитория, двоичный пересобран, коды и строки списаны с
прогона.

нынешний двоичный:  код 1, plan-rules-asked: проб 29, разошлось 12
правленый двоичный: код 0, plan-rules-asked: проб 29, разошлось 0

Двенадцать расхождений — ровно двенадцать строк check по подделкам, ни одной
лишней. Четырнадцать строк test зелены на обоих: правила целы.

Правила не отвергают верное

268 программ дерева с объявлением план прогнаны check --быстро дважды.
Расхождение между двоичными — РОВНО двенадцать файлов, сами подделки (4 → 1,
FLANG_PLAN). Ни один другой файл ответ не сменил. Один файл
(flang/self/bootstrap/emit-from-source.flang) не ответил за 150 с ни у того,
ни у другого — он записан как НЕ МЕРЕН, а не как зелёный.

Шага CI здесь нарочно нет

Проба обязана краснеть сегодня — в этом её смысл. Поставить её шагом в
binary.yml сейчас значит покрасить ствол. Шаг ставится ТЕМ ЖЕ коммитом, что и
правка, и это записано в «Когда задача сделана» у 7706.

Чего этот PR не трогает

Ни flang/self/**, ни flang/proof/tables/**, ни proof-kernel.flang, ни
*.sh/*.mjs, ни bootstrap/**. Код в чужих файлах не писан: правка 7706 —
за владельцем flang/src/emit/c/flang_repl.c.

Отдельно: заметка docs/zettel/plans-are-not-judged-at-all-and-unlike-processes-the-binary-says-nothing.md
устарела целиком — она говорит «ввозит его никто», а судья ввезён коммитом
7bac56022. Править её здесь не стал: чужой файл.

Measured on the trunk seed 188e5a6: all twelve plan forgeries are
rejected by the very same binary when asked through `flang test`, and
accepted silently by `flang check`. Four candidate explanations are
ruled out one by one: the parser carries both plan nodes, the printed
compiler carries the rules and calls them from `Proverit svyazannoe`,
the linker keeps the `plans` field, and the rules answer correctly on
the linked program.

What is left is the one cause: `flang check` repeats the checking road
in `repl_check_sources` and never asks the plan judge. The call was
never there -- `git log --all -S` over `flang/src/emit/c/flang_repl.c`
is empty. The task's former "where the fix lives" pointed at
`flang/self/io.flang`; both files there are right.

The former expectation of return code 2 is corrected to 1: code 2
means "checked NOT to the end", a rule remark gives 1.
A new probe set `flang/proof/probes/plan-rules-asked` runs the
fourteen samples of `flang/test/fixtures/plany` past two judges of one
binary: `flang check` and `flang test`. Twenty nine rows in all.

The expectations are measured, not predicted. The quiet call of the
plan judge was inserted into a copy of the tree outside the
repository, the binary was rebuilt, and every code and line was taken
from that run. On the trunk binary the probe answers code 1 and names
twelve parted rows -- exactly the twelve `check` rows and nothing
else; on the patched binary it answers code 0 and none. The fourteen
`test` rows are green on both: the rules themselves are whole.

Called by the short command `plan-rules:probe` in `.flangrc`. A CI step
belongs with the fix (task 7706): until then the probe is red by
design, and a gate would paint the trunk red for a known debt.
Negative control for 8398 and 7706, measured: all 268 tree programs
that declare a plan were run through `check --fast` twice, once by the
trunk binary and once by a patched copy outside the repository. The
answer changed for exactly twelve files -- the forgeries themselves,
from code 4 to code 1 with FLANG_PLAN. No other file in the tree moved.

Three code-1 answers on the trunk binary are debt older than this
task, and one file did not answer within 150 s under either binary --
it is written down as NOT measured, not as green.

Two more judges of the same binary already ask the rules: `flang test`
and `flang io` without the trust key both reject the forgeries. Only
the road in `repl_check_sources`, shared by `check` and the shell,
stays silent.
@the-homeless-god
the-homeless-god force-pushed the a/8398-twelve-wrong-programs branch from db0f4ac to a73fdec Compare October 4, 2026 14:56
@the-homeless-god
the-homeless-god merged commit 894cdcc into dev Oct 4, 2026
32 checks passed
@the-homeless-god
the-homeless-god deleted the a/8398-twelve-wrong-programs branch October 4, 2026 15:36
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