Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .claude/skills/ci-gates/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6057,3 +6057,56 @@ a build.
**Verify the binary, not the tree, and verify it at the moment you measure.** For
any number that leaves the machine, build from a pristine worktree of the commit
you are naming.

## 183. The branch was taken out from under me, and the tree told me before git did

A `cargo test` came back with one failure, then two clean runs, then a compile
error — `ratchet_compare takes 6 arguments but 5 were supplied`, in a function I
had given 5. `git status` showed `suite.rs` modified with 64 lines I never wrote,
labelled **W700**, and `git log` showed two `wip(parser)` commits authored under
the repo owner's name containing *my* edits.

I was on `w700-gate-failures-ratchet`. Another session shares this checkout,
parked my work on `w699-rung12-parked`, and started its own wave in the same
tree. There are 27 local `w699-*` branches, most of them not mine.

What I did, in order: stopped editing, read the foreign diff without touching it,
copied my one untracked file out, created **my own worktree** at the parked
branch, and finished there. The shared checkout was left exactly as found,
uncommitted W700 work included.

**A build error in code you did not write is a signal about the tree, not the
code.** And the fix is `git worktree add`, once, before the first edit — the
recipe was already in my memory and I had not followed it.

## 184. The per-entry ratchet caught me the day after I built it

Rung 12 seeded a column so a body opening with a call could lower. The corpus
total FELL — 23 926 to 23 738 — and the acceptance columns did not move. By every
aggregate it was a clean win.

The ledger disagreed:

> phi_split_optimality.t27 discards 214, pinned at 129 (+85)
> phi_universal_attractor.t27 discards 108, pinned at 73 (+35)

`given (exp, mant) = f(15)` is an identifier followed by `(` — the bare-call arm
matched a **clause keyword**. Nothing had tested that, because before the seed
the arm could not reach a block's first token at all.

**A total that falls can hide two entries that rose.** Pinning per item is what
turns "it got better" into "it got better here and worse there", and it caught
its author within a day of being written.

## 185. My first fix for it made things worse, and the measurement said so

The obvious explanation was that seeding `first_clause_col` skewed the W905
anchor, so I stopped writing it. Total went 23 738 → **24 046** and the spec was
still broken: wrong theory, and the number said so in one build.

The real cause was the clause keyword. Excluding `given`/`when`/`then`/… took it
to 23 644 with both regressions gone.

**Re-measure after the fix for a regression, not just after the regression.** A
plausible cause that makes the number worse is a cause you have disproved, and
that is worth more than the twenty minutes it saves.
4 changes: 2 additions & 2 deletions .trinity/seals/Backend.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"gen_hash_c": "sha256:be518058492e9f9d96104e45626207f35a34fb76f5ccf870129a1e78c4dd9931",
"gen_hash_c": "sha256:4b1c8189fba34b478a363da5c4881b9ad022b7b2d2ce86cd7b074246f2ca22fe",
"gen_hash_rust": "sha256:1c41217fa0332c341d72d71e2da67611845e7604b164647febc993997104491d",
"gen_hash_verilog": "sha256:a9d64159297b926cc1d3f1c8760f25f5e325495620e99d4b959b9f9a2f699df4",
"gen_hash_zig": "sha256:89ae4a7007090158aa67794ee09ce087bb12d673062e8016f57a2378d1e4e791",
"gen_hash_zig": "sha256:da68a0284c02e33b15201029060202d81a344d440e0f3abcb9bdcb8ac8f92d18",
"module": "Backend",
"ring": 32,
"sealed_at": "2026-08-28T18:19:55Z",
Expand Down
4 changes: 2 additions & 2 deletions .trinity/seals/NotebookLM.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"gen_hash_c": "sha256:8327045659d0a33941fca077d77f34085e58d55bad7f6026a374bede4a64a47e",
"gen_hash_c": "sha256:367a57ed5a3fb0f2ace886c32e4073be14c09fe05ceb70778a389688fc9b2d1c",
"gen_hash_rust": "sha256:00ac71751ae678d213da795b42b2914a20852050c87acffb307d19dc03f76677",
"gen_hash_verilog": "sha256:7716f39dc3d0baf658917208a7c294da3ed66d8d849778e3a0d170e7083115b4",
"gen_hash_zig": "sha256:35c111b1b1f97a0694969c33df116e35baaa41fbec2fb64459428017a6ea8aec",
"gen_hash_zig": "sha256:e83bfad4e48bfe63c0f034b994a425e97f509126fd4f12af2d1a77bc52417799",
"module": "NotebookLM",
"ring": 12,
"sealed_at": "2026-08-28T21:20:51Z",
Expand Down
4 changes: 2 additions & 2 deletions .trinity/seals/SDK.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"gen_hash_c": "sha256:ae82bdc29a0ee48b533a561dee765a2d403de165353e3547012f534292e488b2",
"gen_hash_c": "sha256:51cdac0bde0a6500495bd14aee204687fc27db3afe19f2872bf807879fccb152",
"gen_hash_rust": "sha256:664f77f91a5a2b809f6445ae0c186969b76e915fd5654189b4c46210e8d548c7",
"gen_hash_verilog": "sha256:6c6e94d5b8622c0589f7401de7c6f36228864f7f30960281ad3edd4d1f664489",
"gen_hash_zig": "sha256:7e4462e98c4870d44fd1ba1d919ffffd47bc0514a825c14ab99fe391c912c108",
"gen_hash_zig": "sha256:831841c3ba2193cb6a476291b8a2274a70c52377995ada877e73ab85cae8b395",
"module": "SDK",
"ring": 12,
"sealed_at": "2026-08-28T21:20:51Z",
Expand Down
4 changes: 2 additions & 2 deletions .trinity/seals/TernaryGates.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"gen_hash_c": "sha256:070c44a8ba832e04f27b27c51498197fc9cb8c72a4d2daab40ad13a02b872002",
"gen_hash_c": "sha256:0d5d15f3998b57dd91e1c8c2cb0d1ad46cd9d15d385401a319fe6c83819f2992",
"gen_hash_rust": "sha256:d7d26e54ab7148afba6e80c14ec30ba851b5309ac4ebb7c43a4ceda8ec05e7ce",
"gen_hash_verilog": "sha256:a0ecc024bbf108bf40c663321efaadc401dc9e22f8d45323eae4913dc08738bc",
"gen_hash_zig": "sha256:0c1365aed5c52480143c88fcdc1211113cfb1e4ce84985a665d8f544fe13addc",
"gen_hash_zig": "sha256:a43a38f39711b6fe6215498a4bb7f14ab0ad83b7d6bf58065e33b49a9f0eedce",
"module": "TernaryGates",
"ring": 12,
"sealed_at": "2026-08-28T21:20:51Z",
Expand Down
6 changes: 3 additions & 3 deletions .trinity/seals/coder_igla-coder-arch.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"gen_hash_c": "sha256:34cf3ad46747be021ad5bdab36c2597858fd0a6c480f7cd59b3f2423b666e5c8",
"gen_hash_c": "sha256:c675ed2944429088e1fe541d909f8a3173524805ad07a11a0b6bc34cfc94b7c0",
"gen_hash_rust": "sha256:7f8f8cb58c92fef74f24a34f6f8d579a020a8711c17dfa4c4559623082762217",
"gen_hash_verilog": "sha256:bab39c53d3451ae55466f2ea2e148d3be52e1957b5cafecc47153a84be4b047e",
"gen_hash_zig": "sha256:f0d21da49c6ce027a5b441e3e5378109708e7de99a403a3605ed2dbfca56c0bb",
"gen_hash_zig": "sha256:ca1a55aca26e4cff5a262c3d17f54d0bf92d5749cba30e0899a58cdb6e33ea30",
"module": "igla-coder-arch",
"ring": 12,
"sealed_at": "2026-08-29T01:19:56Z",
"sealed_at": "2026-08-29T06:21:48Z",
"sealed_by": "t27c-bootstrap@0.2.0",
"spec_hash": "sha256:baafdfb69f57527162bec359e9439edb7e0049f421019912200889abf9386707",
"spec_path": "specs/igla/coder/arch.t27"
Expand Down
6 changes: 3 additions & 3 deletions .trinity/seals/coder_igla-coder-dataset.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"gen_hash_c": "sha256:74b318ef6f2c0ab77f62ee391596303f77e760f4305700c07c600618990ab68d",
"gen_hash_c": "sha256:e8952b010a855f7d6e23eb45295c4cf46aa0e6ceb3122652509b0b49ebfddc7c",
"gen_hash_rust": "sha256:e35a042744223bd76b1965638408ceba6b2c8b8e2d14a110c1b32bdc10b83806",
"gen_hash_verilog": "sha256:54381fd4021b966b1d5babad69be8534b085d899242ceced55f3f7b6f7be3fe9",
"gen_hash_zig": "sha256:a2d16812226d462f90d93e23f3463a5822b0c99fd60869ed1eef945a1e5315b7",
"gen_hash_zig": "sha256:92a79b60f92277da0a860e17331d6f77480e2938db0f3fa3337ecb0f99df22d6",
"module": "igla-coder-dataset",
"ring": 12,
"sealed_at": "2026-08-29T01:19:56Z",
"sealed_at": "2026-08-29T06:21:48Z",
"sealed_by": "t27c-bootstrap@0.2.0",
"spec_hash": "sha256:ea96b62813533b36a3742b1587b381e4ec1566e5e8e2a9a6a8cd0a4edf716c6c",
"spec_path": "specs/igla/coder/dataset.t27"
Expand Down
6 changes: 3 additions & 3 deletions .trinity/seals/isa_TernaryGates.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"gen_hash_c": "sha256:070c44a8ba832e04f27b27c51498197fc9cb8c72a4d2daab40ad13a02b872002",
"gen_hash_c": "sha256:0d5d15f3998b57dd91e1c8c2cb0d1ad46cd9d15d385401a319fe6c83819f2992",
"gen_hash_rust": "sha256:d7d26e54ab7148afba6e80c14ec30ba851b5309ac4ebb7c43a4ceda8ec05e7ce",
"gen_hash_verilog": "sha256:a0ecc024bbf108bf40c663321efaadc401dc9e22f8d45323eae4913dc08738bc",
"gen_hash_zig": "sha256:0c1365aed5c52480143c88fcdc1211113cfb1e4ce84985a665d8f544fe13addc",
"gen_hash_zig": "sha256:a43a38f39711b6fe6215498a4bb7f14ab0ad83b7d6bf58065e33b49a9f0eedce",
"module": "TernaryGates",
"ring": 12,
"sealed_at": "2026-08-29T04:11:28Z",
"sealed_at": "2026-08-29T06:21:48Z",
"sealed_by": "t27c-bootstrap@0.2.0",
"spec_hash": "sha256:b4ea36c976d78efe1add7b0ec95018c0f01877755c257dac8482eeb7576f1909",
"spec_path": "specs/isa/ternary_gates.t27"
Expand Down
6 changes: 3 additions & 3 deletions .trinity/seals/memory_NotebookLM.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"gen_hash_c": "sha256:8327045659d0a33941fca077d77f34085e58d55bad7f6026a374bede4a64a47e",
"gen_hash_c": "sha256:367a57ed5a3fb0f2ace886c32e4073be14c09fe05ceb70778a389688fc9b2d1c",
"gen_hash_rust": "sha256:00ac71751ae678d213da795b42b2914a20852050c87acffb307d19dc03f76677",
"gen_hash_verilog": "sha256:7716f39dc3d0baf658917208a7c294da3ed66d8d849778e3a0d170e7083115b4",
"gen_hash_zig": "sha256:35c111b1b1f97a0694969c33df116e35baaa41fbec2fb64459428017a6ea8aec",
"gen_hash_zig": "sha256:e83bfad4e48bfe63c0f034b994a425e97f509126fd4f12af2d1a77bc52417799",
"module": "NotebookLM",
"ring": 12,
"sealed_at": "2026-08-29T04:11:28Z",
"sealed_at": "2026-08-29T06:21:48Z",
"sealed_by": "t27c-bootstrap@0.2.0",
"spec_hash": "sha256:dc5b054f79d747598c75190379fe4a36400bb27af13dffe06d438f145c1af96f",
"spec_path": "specs/memory/notebooklm.t27"
Expand Down
6 changes: 3 additions & 3 deletions .trinity/seals/race_igla-race-backend.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"gen_hash_c": "sha256:be518058492e9f9d96104e45626207f35a34fb76f5ccf870129a1e78c4dd9931",
"gen_hash_c": "sha256:4b1c8189fba34b478a363da5c4881b9ad022b7b2d2ce86cd7b074246f2ca22fe",
"gen_hash_rust": "sha256:1c41217fa0332c341d72d71e2da67611845e7604b164647febc993997104491d",
"gen_hash_verilog": "sha256:a9d64159297b926cc1d3f1c8760f25f5e325495620e99d4b959b9f9a2f699df4",
"gen_hash_zig": "sha256:89ae4a7007090158aa67794ee09ce087bb12d673062e8016f57a2378d1e4e791",
"gen_hash_zig": "sha256:da68a0284c02e33b15201029060202d81a344d440e0f3abcb9bdcb8ac8f92d18",
"module": "igla-race-backend",
"ring": 12,
"sealed_at": "2026-08-29T01:19:56Z",
"sealed_at": "2026-08-29T06:21:48Z",
"sealed_by": "t27c-bootstrap@0.2.0",
"spec_hash": "sha256:1262feb6bf7fe0c0672a7985bd86b2b07a3e1e9eccf6226d47c6ee7c9ca5d2ca",
"spec_path": "specs/igla/race/backend.t27"
Expand Down
6 changes: 3 additions & 3 deletions .trinity/seals/race_igla-race-cordic-top.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"gen_hash_c": "sha256:ef4f41400ff2f064d61513da02965b70373c2a9df16238155299ca1e726fd161",
"gen_hash_c": "sha256:dabc754ac0708c8f9a3e29ea070b70558d80ae5da0a8dd01a08a3ee88c35ad02",
"gen_hash_rust": "sha256:c643445e277d654e432068eea6e9958ccc45b6e394603376c38e3791e8d7c097",
"gen_hash_verilog": "sha256:4cbfacb005043739944c0fa4ca55fe2f648875c771cb94a9c35e338b9e5eb610",
"gen_hash_zig": "sha256:5afe1ae2b906f855f5cbddf6337351d42c81132d32851f36ffa2c74791a8dd23",
"gen_hash_zig": "sha256:8ff5e034f48f3b8e6f53c000be5be8b9329f76d27aaf2c06ecb2cc5c55618a09",
"module": "igla-race-cordic-top",
"ring": 12,
"sealed_at": "2026-08-29T04:46:46Z",
"sealed_at": "2026-08-29T06:21:48Z",
"sealed_by": "t27c-bootstrap@0.2.0",
"spec_hash": "sha256:ef4e2d3e90d9a3b29abb9254cd70e3dd011a566eb73155b4efb7fa340a7db6b8",
"spec_path": "specs/igla/race/cordic_top.t27"
Expand Down
6 changes: 3 additions & 3 deletions .trinity/seals/race_igla-race-cordic.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"gen_hash_c": "sha256:4d83c6d806ff734ba4c40935fb1becdf6fecf30d5e0f67a8219d23a95207480a",
"gen_hash_c": "sha256:3bce7dab413692b9fd50f0f2ba0acbef640be5e3cdafae14db962b40c3991c88",
"gen_hash_rust": "sha256:3d4093cb5ccc22bcdc45294fda922011cbad4e5ab50166068cab00b9d8ab39a2",
"gen_hash_verilog": "sha256:c9e69ccb364d8d65010e8cc2765a6ef7e0c1f62428e1504afff4424c633923f2",
"gen_hash_zig": "sha256:d4dfe7f5e5387628ffbe02abb57da2b387ed7ba8ae8b0b38a049ff5522856321",
"gen_hash_zig": "sha256:207f51854e2ccbc4fe79471ac1f856c684a757f6f2847d0aa1006c6c0cc353d6",
"module": "igla-race-cordic",
"ring": 12,
"sealed_at": "2026-08-29T01:19:56Z",
"sealed_at": "2026-08-29T06:21:48Z",
"sealed_by": "t27c-bootstrap@0.2.0",
"spec_hash": "sha256:54b1b8bed209dbc8d3dfc4540fd6a44e8dabe47ae4d264d7f0d30df32a0fa6aa",
"spec_path": "specs/igla/race/cordic.t27"
Expand Down
6 changes: 3 additions & 3 deletions .trinity/seals/race_igla-race-systolic-array.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"gen_hash_c": "sha256:e5bc0273d52d6d7523328793605c0f2640e9846547195ded8131ac5265fb43dc",
"gen_hash_c": "sha256:ecd7259008607359e92fea88c82e369837ddfb971784b18c43023ea90cb5ea8c",
"gen_hash_rust": "sha256:9b4d2e3b1046f04f33c652d2a7e5e482d7e5ba92f45d94f6359ad5cc8ffc34f4",
"gen_hash_verilog": "sha256:6bda0a419da1aa120f7afd4e6e355753829e6b4a97a975451678b4d39de71061",
"gen_hash_zig": "sha256:cc68e989b4243ce4d92d9b33fb04dd725212e270966ab897a7fba5ac983f4900",
"gen_hash_zig": "sha256:59e03bcbeafe2e97e840e7f614f8ea357ad63d61b1841b3aac201a18761c688b",
"module": "igla-race-systolic-array",
"ring": 12,
"sealed_at": "2026-08-29T01:19:56Z",
"sealed_at": "2026-08-29T06:21:48Z",
"sealed_by": "t27c-bootstrap@0.2.0",
"spec_hash": "sha256:55ef8dde9d116d74e0c6e6e911893ba51116745d541532de44768b18cc3a188e",
"spec_path": "specs/igla/race/systolic_array.t27"
Expand Down
6 changes: 3 additions & 3 deletions .trinity/seals/race_igla-race-systolic-ternary.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"gen_hash_c": "sha256:b32767e698e1d089dd2159aee1cc8d3689833444f09ad5b75c917db7af07ffbc",
"gen_hash_c": "sha256:ae88615b1147aecac767fbef0e7ce792ac435b93ecca57c03a98fffd1f6e7908",
"gen_hash_rust": "sha256:436bebf1e7a7b14c204dc34b673107fa0852fc96100ec1aadd9e608ee714941b",
"gen_hash_verilog": "sha256:29244ceb3b49d238c23d8cf1f3283599058ca8953158e58b7f3d1a58692dc8b5",
"gen_hash_zig": "sha256:f163ad7b571842572050c7f7c64b0888dc6fcb7aade10634737c344a2fe7fea7",
"gen_hash_zig": "sha256:48104e1b192221fe652667fa8725d40daf79a94ba3e58c74fff6d9ddef595010",
"module": "igla-race-systolic-ternary",
"ring": 12,
"sealed_at": "2026-08-29T01:19:57Z",
"sealed_at": "2026-08-29T06:21:49Z",
"sealed_by": "t27c-bootstrap@0.2.0",
"spec_hash": "sha256:968bea4fd52e44b99e900e9ae7b6e1642783a98413791edae61f450d59ead18f",
"spec_path": "specs/igla/race/systolic_ternary.t27"
Expand Down
6 changes: 3 additions & 3 deletions .trinity/seals/transformer_FeedForwardLayer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"gen_hash_c": "sha256:b30111fd17c2b1ad7c01ce947dafba7d3bc7edafb7e7e4b8420058d94e0e0d1a",
"gen_hash_c": "sha256:adb5a0dc8801de20ad2fb06ce4a99a8932fc2ff8cde0b5a335ba7e6b276077f9",
"gen_hash_rust": "sha256:e663f901aa3c737e45fa7b2dd27584f2343effba7aa2b35046125d964158748f",
"gen_hash_verilog": "sha256:d6a7c28e1339137679393330dd7b901a877efd42af5a3ff06666f0192e5aa6c0",
"gen_hash_zig": "sha256:c7dbe859d6dfe13c24f653c60c02d9629d25b0667413d44ddfd250faad95c461",
"gen_hash_zig": "sha256:91f9c4156a44a93aaf5617a61c4cc33975eae786d89e8ce94d57ee4f3e39661a",
"module": "FeedForwardLayer",
"ring": 12,
"sealed_at": "2026-08-29T04:11:29Z",
"sealed_at": "2026-08-29T06:21:49Z",
"sealed_by": "t27c-bootstrap@0.2.0",
"spec_hash": "sha256:0774668f000b9f30569b5640ba0a091dba5107d3b8f591bc69a6daf196915ae6",
"spec_path": "specs/ml/transformer/feed_forward.t27"
Expand Down
6 changes: 3 additions & 3 deletions .trinity/seals/vsa_SDK.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"gen_hash_c": "sha256:ae82bdc29a0ee48b533a561dee765a2d403de165353e3547012f534292e488b2",
"gen_hash_c": "sha256:51cdac0bde0a6500495bd14aee204687fc27db3afe19f2872bf807879fccb152",
"gen_hash_rust": "sha256:664f77f91a5a2b809f6445ae0c186969b76e915fd5654189b4c46210e8d548c7",
"gen_hash_verilog": "sha256:6c6e94d5b8622c0589f7401de7c6f36228864f7f30960281ad3edd4d1f664489",
"gen_hash_zig": "sha256:7e4462e98c4870d44fd1ba1d919ffffd47bc0514a825c14ab99fe391c912c108",
"gen_hash_zig": "sha256:831841c3ba2193cb6a476291b8a2274a70c52377995ada877e73ab85cae8b395",
"module": "SDK",
"ring": 12,
"sealed_at": "2026-08-29T04:11:28Z",
"sealed_at": "2026-08-29T06:21:48Z",
"sealed_by": "t27c-bootstrap@0.2.0",
"spec_hash": "sha256:7843aca460336f24ba9026067e1e642e110cb6d2a995064bf9613eaed662c115",
"spec_path": "specs/vsa/sdk.t27"
Expand Down
44 changes: 42 additions & 2 deletions bootstrap/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6033,11 +6033,43 @@ impl Parser {
// Same guards as the const/var arm: only after the block's column is
// known, only at or deeper than it, never at column 1 where a body
// statement and a module declaration are indistinguishable (W905).
// W699 rung 12: a body that OPENS with a call has no earlier clause
// to take a column from, so `first_clause_col` was still None and
// this arm never ran. A `bench` beginning
//
// bench ternary_not_performance
// @setEvalBranchQuota(10000);
// var result : i32 = 0;
//
// lost the whole block for that reason. The const/var arm already
// seeds the column from the statement itself when it is the first
// thing in the block (W904); this is the same seed, and the `c > 1`
// guard against unindented blocks is unchanged.
let call_col = if lowered == 0 {
first_clause_col.or(Some(self.current.col))
} else {
first_clause_col
};
// ... and a CLAUSE KEYWORD is never a call, however much it looks
// like one. `given (exp, mant) = f(15)` is an Ident followed by `(`,
// and before the column was seeded the arm could not reach a block's
// FIRST token, so nothing had ever tested that. Seeding it exposed
// the hole immediately: two specs went from lowering cleanly to
// stopping mid-clause, +120 discarded tokens, while the corpus total
// still fell. The per-entry ratchet named both; the total hid them.
let clause_head = matches!(
self.current.lexeme.as_str(),
"given" | "when" | "then" | "assert" | "and" | "measure" | "target"
);
if self.current.kind == TokenKind::Ident
&& !clause_head
&& self.peek.kind == TokenKind::LParen
&& adjacent
&& first_clause_col.is_some_and(|c| c > 1 && self.current.col >= c)
&& call_col.is_some_and(|c| c > 1 && self.current.col >= c)
{
if first_clause_col.is_none() {
first_clause_col = call_col;
}
let st_call = self.save_state();
match self.parse_body_stmt() {
Ok(stmt) => {
Expand All @@ -6048,7 +6080,15 @@ impl Parser {
}
// A shape this cannot read must cost only itself: restore and
// fall through to the clause reading, exactly as before.
Err(_) => self.restore_state(st_call),
Err(_) => {
// Restore the column too: a seed that survives a failed
// parse would let a LATER shallower statement pass the
// `>= c` guard on a column this block never established.
self.restore_state(st_call);
if lowered == 0 {
first_clause_col = None;
}
}
}
}
if self.current.kind != TokenKind::Ident && !and_kw {
Expand Down
8 changes: 8 additions & 0 deletions bootstrap/src/parse_conform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,14 @@ version of this is the parse-no-discard suite phase.",
discards: Some(0),
note: "the binding arm peeked for `=` immediately after the name, so an annotation between them read as `not a binding` and the whole block went to the discard",
},
Case {
name: "a_body_may_open_with_a_call",
input: "module m\n\n bench b\n setup(10000);\n var n : usize = 0;\n assert n == 0\n",
verdict: Verdict::Full,
decls: Some(1),
discards: Some(0),
note: "a body that OPENS with a call has no earlier clause to take a column from, so `first_clause_col` was None and the bare-call arm never ran. The const/var arm already seeds the column from the statement itself; this is the same seed. Three bench blocks opening with `@setEvalBranchQuota(10000);` lost everything to it",
},
Case {
name: "unterminated_fn_body",
input: "module m\n\nfn a() -> u32 { return 1;\n",
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/stage0/FROZEN_HASH
Original file line number Diff line number Diff line change
@@ -1 +1 @@
347e84842d907365acafa9edcd4384f1d2d202e381d0babaafb272a690f46d51
d25ac0cc159eda78660cdb07df0d388acd34ae8e5c1e4ac73f99f939667d390b
Loading
Loading