Appearance
Go: three differential failures on random seeds
Date: 2026-12-05
Context
Several seeds of tests/go/differential failed on main after #374:
- Seed 193470665: "the operator '/' is not supported". The proved path refused
P4F2, so the function went to the legacy translator, which has no/. The proved path refused it because of the statementv83, _ := P4F0(-(v80[:][p0]), "Go", true). #374 refused a slice next to another check when both sat inside the arguments of one call. Seed 103 failed in the same way. gc tests the slice first here too, and the interpreter agrees, so the translator was wrong. - Seed 31337:
go runfailed with "declared and not used". The generator wrote a computed bound forxs[a:], which marked a local as used, and then dropped that bound. The generator was wrong. - Seed 110, once the generator changed:
p.X = …printed aslet p := { p with X := … }, and a laterdecide (p ≠ p)left Lean with a stuckDecidableinstance. Lean did not know the type ofpyet. The printer was wrong.
Before this change, seed 110 passed on main. Its earlier failures came from a stale local binary.
Decision
Pure.slicesFirstkeeps only the order rule, which is that a slice and its checks come first and no slice comes later. The mixing rule stays inorderKnown, as before #374: checks inside the arguments of a call,lenorappendmay not be mixed with checks outside them. A slice counts as a check where it sits.- The generator keeps the computed bound it wrote. When it writes
int(s[i]), it now generatessbeforei, in printed order, so its count of checks sees the outer index before a slice ini. PrintTyhas a newstructUpdatemethod. Its default keeps{ b with … }, so TypeScript output is unchanged. Go prints({ b with … } : type_of% b).
translate_sound is unchanged. The proved path now refuses less, and its proof does not depend on the order rule.
Refused
These statements are still refused:
- a slice inside the arguments of a call,
lenorappendtogether with a check outside them, or the reverse, such aslen(s[2:]) + s[0]orG(t[0], len(s[2:]) > 0).
tests/go/EvalOrder.lean and tests/go/Structs.lean hold the regressions.
This page is docs/decisions/2026-12-05-go-differential-seeds.md at commit 5f1d031.
