diff --git a/.claude/skills/ci-gates/SKILL.md b/.claude/skills/ci-gates/SKILL.md index 9aa2cb85f9..2fcc66a913 100644 --- a/.claude/skills/ci-gates/SKILL.md +++ b/.claude/skills/ci-gates/SKILL.md @@ -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. diff --git a/.trinity/seals/Backend.json b/.trinity/seals/Backend.json index b0a356c0d1..aa96751258 100644 --- a/.trinity/seals/Backend.json +++ b/.trinity/seals/Backend.json @@ -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", diff --git a/.trinity/seals/NotebookLM.json b/.trinity/seals/NotebookLM.json index 8160e19d02..7452b5419f 100644 --- a/.trinity/seals/NotebookLM.json +++ b/.trinity/seals/NotebookLM.json @@ -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", diff --git a/.trinity/seals/SDK.json b/.trinity/seals/SDK.json index 78738b9437..1ae03b6bd4 100644 --- a/.trinity/seals/SDK.json +++ b/.trinity/seals/SDK.json @@ -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", diff --git a/.trinity/seals/TernaryGates.json b/.trinity/seals/TernaryGates.json index 4eaf0ed877..340be2cc16 100644 --- a/.trinity/seals/TernaryGates.json +++ b/.trinity/seals/TernaryGates.json @@ -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", diff --git a/.trinity/seals/coder_igla-coder-arch.json b/.trinity/seals/coder_igla-coder-arch.json index 2c22a7a468..772f145600 100644 --- a/.trinity/seals/coder_igla-coder-arch.json +++ b/.trinity/seals/coder_igla-coder-arch.json @@ -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" diff --git a/.trinity/seals/coder_igla-coder-dataset.json b/.trinity/seals/coder_igla-coder-dataset.json index 4018e869ab..d1d52d2c46 100644 --- a/.trinity/seals/coder_igla-coder-dataset.json +++ b/.trinity/seals/coder_igla-coder-dataset.json @@ -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" diff --git a/.trinity/seals/isa_TernaryGates.json b/.trinity/seals/isa_TernaryGates.json index 557c42059c..f18a3a2f07 100644 --- a/.trinity/seals/isa_TernaryGates.json +++ b/.trinity/seals/isa_TernaryGates.json @@ -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" diff --git a/.trinity/seals/memory_NotebookLM.json b/.trinity/seals/memory_NotebookLM.json index d7a5747225..4c8e73e98b 100644 --- a/.trinity/seals/memory_NotebookLM.json +++ b/.trinity/seals/memory_NotebookLM.json @@ -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" diff --git a/.trinity/seals/race_igla-race-backend.json b/.trinity/seals/race_igla-race-backend.json index 27e0461158..53d34dafe0 100644 --- a/.trinity/seals/race_igla-race-backend.json +++ b/.trinity/seals/race_igla-race-backend.json @@ -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" diff --git a/.trinity/seals/race_igla-race-cordic-top.json b/.trinity/seals/race_igla-race-cordic-top.json index f84ff8a83a..fc04ef1e1e 100644 --- a/.trinity/seals/race_igla-race-cordic-top.json +++ b/.trinity/seals/race_igla-race-cordic-top.json @@ -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" diff --git a/.trinity/seals/race_igla-race-cordic.json b/.trinity/seals/race_igla-race-cordic.json index 4e6a2dff9d..4b80c1a8dd 100644 --- a/.trinity/seals/race_igla-race-cordic.json +++ b/.trinity/seals/race_igla-race-cordic.json @@ -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" diff --git a/.trinity/seals/race_igla-race-systolic-array.json b/.trinity/seals/race_igla-race-systolic-array.json index a4e963b5b7..a38d995143 100644 --- a/.trinity/seals/race_igla-race-systolic-array.json +++ b/.trinity/seals/race_igla-race-systolic-array.json @@ -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" diff --git a/.trinity/seals/race_igla-race-systolic-ternary.json b/.trinity/seals/race_igla-race-systolic-ternary.json index 351e45765c..1880b91ce3 100644 --- a/.trinity/seals/race_igla-race-systolic-ternary.json +++ b/.trinity/seals/race_igla-race-systolic-ternary.json @@ -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" diff --git a/.trinity/seals/transformer_FeedForwardLayer.json b/.trinity/seals/transformer_FeedForwardLayer.json index 1eb215a1a9..132ac44d51 100644 --- a/.trinity/seals/transformer_FeedForwardLayer.json +++ b/.trinity/seals/transformer_FeedForwardLayer.json @@ -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" diff --git a/.trinity/seals/vsa_SDK.json b/.trinity/seals/vsa_SDK.json index 2f0be6faf3..72a35615f8 100644 --- a/.trinity/seals/vsa_SDK.json +++ b/.trinity/seals/vsa_SDK.json @@ -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" diff --git a/bootstrap/src/compiler.rs b/bootstrap/src/compiler.rs index d462cdfc26..a5fa0c6699 100644 --- a/bootstrap/src/compiler.rs +++ b/bootstrap/src/compiler.rs @@ -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) => { @@ -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 { diff --git a/bootstrap/src/parse_conform.rs b/bootstrap/src/parse_conform.rs index 41d353cceb..62e43077be 100644 --- a/bootstrap/src/parse_conform.rs +++ b/bootstrap/src/parse_conform.rs @@ -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", diff --git a/bootstrap/stage0/FROZEN_HASH b/bootstrap/stage0/FROZEN_HASH index 5baa2ea2e0..f9e3005115 100644 --- a/bootstrap/stage0/FROZEN_HASH +++ b/bootstrap/stage0/FROZEN_HASH @@ -1 +1 @@ -347e84842d907365acafa9edcd4384f1d2d202e381d0babaafb272a690f46d51 +d25ac0cc159eda78660cdb07df0d388acd34ae8e5c1e4ac73f99f939667d390b diff --git a/docs/DISCARD_WHAT_IS_LEFT.md b/docs/DISCARD_WHAT_IS_LEFT.md new file mode 100644 index 0000000000..adbca6a832 --- /dev/null +++ b/docs/DISCARD_WHAT_IS_LEFT.md @@ -0,0 +1,92 @@ +# What is left in the discard, and who has to decide it + +**Status:** census. Regenerated by the commands at the bottom; the numbers below +were produced by them on 2026-08-29 at master `947d2614`. + +W699 began with 33 777 tokens the parser read and threw away across 87 specs. +Twelve rungs later it is **23 738 tokens across 75 specs**, and the composition +has changed completely: what remains is not a list of parser gaps. + +## The census + +964 whole-block fallback events, classified by reading the source line each one +fired on: + +| class | events | share | example | +|---|---|---|---| +| **quantification** | 901 | 93.5% | `assert trit_mul_closed(a, b) == trit_mul_closed(b, a) for all Trit` | +| other | 53 | 5.5% | `invariant total > 0;` | +| mathematical `=` for equality | 6 | 0.6% | `assert lim(n->inf) Fib(n+1)/Fib(n) = PHI` | +| Zig-style `for` capture | 4 | 0.4% | `for (const i) \|reg\| in [0u8, 5, 10, 15, 20, 26] {` | + +## Quantification is not "one construct in 35 specs" + +It is nearly everything, and it arrives in **four different notations**: + +``` +invariant name: forall c : CordicTop, c.iterations > 0 594 events +invariant name 269 events + forall prompt : string, bank : WeightBank, ... +assert P(a, b) == P(b, a) for all Trit 35 events +assert P(pow(x,a),b) == ... for positive x, integer n 4 events +``` + +The first two are the same construct with and without a colon. The last two are +the same idea written as a *suffix* — a mathematician's `∀` moved to the end of +the line. All four say: **this holds for every value of these variables.** + +An earlier pass of this loop reported the 38 `for` events as "specs written in a +syntax the language does not have, `for (const i) |reg| in [...]`". That was +wrong: 35 of the 38 are quantifier suffixes and only 3 are the Zig capture form. +The correction matters because it moves those events from *nobody's problem* to +**#2774's problem**, and #2774 is now 93.5% of everything left. + +## What each class needs + +**Quantification — #2774, and it is an owner decision.** What a universally +quantified assertion *means* at codegen commits four backends: bounded +enumeration over a finite domain, an assumption the backend may rely on and never +check, or a proof obligation exported to the Lean layer. `==>` lowered to +`!a || b` makes a false antecedent a pass, which is the vacuous-truth shape +`no-vacuous-invariant` exists to catch, arriving through the front door. + +Nothing here argues for lowering it badly. A quantified assertion lowered to +`assert true` would move 901 events out of the discard column and into a worse +place: generated code that claims to check something and does not. The discard at +least reports itself. + +**Mathematical `=` — six lines, spec-side.** `assert X = Y` uses a single `=` +where t27 needs `==`; `=` is assignment, so the value parse over-consumes and the +block falls back. Six occurrences, and each is a one-character edit in the spec. +Some carry prose the language also lacks (`+/- 1.5e-15`, `within 1e-6`). + +**Zig-style `for` capture — four lines, spec-side.** `for (const i) |reg| in +[...]` is neither t27 nor Zig; Zig writes `for ([_]u8{...}) |reg| {`. + +**Other, 53 events — a mixed tail**, and the only class where a parser rung might +still be hiding. `invariant total > 0;` (a trailing semicolon on an inline +predicate), `uart_state.rx_data = 0x99;` (a dotted lvalue at clause position), +`target: < 150ns` (a bench metadata line with a comparison). None is more than a +handful. + +## The honest summary for whoever picks this up + +**The parser side of W699 is finished until #2774 is answered.** Twelve rungs +took 10 039 tokens out of the discard without a single acceptance column moving +against us on balance, and what is left is one language decision plus about +sixty lines of spec-side edits. + +## Regenerate + +```bash +t27c parse-complete # totals +t27c parse-complete --fallbacks # the 964 events by why and clause +t27c parse-complete --fallbacks --show # one spec, with source lines +tri discard top # ranked by tokens, against the pinned bound +tri abandoned list # recoveries whose comment names what they discard +``` + +The class column above is a keyword match over the source line each event fired +on (`for all` / `forall` / a bare `=` in an assert / `for (`). It is coarse, and +`other` is where anything mis-binned lands — 53 events, small enough not to move +the conclusion. diff --git a/docs/now/2026-08-29-a-clause-keyword-is-not-a-call-and-the-ledger-said-so.md b/docs/now/2026-08-29-a-clause-keyword-is-not-a-call-and-the-ledger-said-so.md new file mode 100644 index 0000000000..9c199707cb --- /dev/null +++ b/docs/now/2026-08-29-a-clause-keyword-is-not-a-call-and-the-ledger-said-so.md @@ -0,0 +1,8 @@ +# NOW -- A clause keyword is not a call, and the ledger said so (2026-08-29) + +## A clause keyword is not a call, and the ledger said so (Refs #2754) + +- rung 12 seeded a column so a body opening with a call can lower: 23926 -> 23644 tokens, 76 -> 75 specs +- the corpus total fell and no acceptance column moved, while TWO specs got worse by 120 tokens -- the per-entry ratchet named both +- cause: given (exp, mant) = f(15) is an Ident followed by ( and the arm matched a clause keyword; before the seed it could not reach a block's first token, so nothing had tested it +- my first fix made the total worse (24046) and the spec was still broken -- a disproved theory in one build diff --git a/docs/reports/suite_expectations.json b/docs/reports/suite_expectations.json index 88ceaeb3eb..03f94048f6 100644 --- a/docs/reports/suite_expectations.json +++ b/docs/reports/suite_expectations.json @@ -2,7 +2,7 @@ "schema_version": 1, "generated_by": "t27c suite --bless-expectations", "max_gate_failures": 42, - "max_entries": 167, + "max_entries": 166, "entries": [ { "path": "specs/account/repo.t27", @@ -843,18 +843,6 @@ "issue": 1959, "expires": "2026-11-30" }, - { - "path": "specs/isa/ternary_gates.t27", - "phase": "parse-no-discard", - "reason": "parser reaches EOF but DISCARDS top-level tokens (pre-existing; the file is byte-identical to its pre-image)", - "issue": 2474, - "expires": "2026-11-30", - "discard_tokens": 28, - "discard_by_channel": { - "bdd-block-fallback": 21, - "brace-body/in-fallback": 7 - } - }, { "path": "specs/isa/ternary_memory.t27", "phase": "parse-no-discard", @@ -969,12 +957,11 @@ "reason": "top-level drop-recovery discards tokens; parser reaches EOF so `parse` reports success (T42)", "issue": 1959, "expires": "2026-11-30", - "discard_tokens": 441, + "discard_tokens": 409, "discard_by_channel": { - "bdd-block-fallback": 58, + "bdd-block-fallback": 16, "brace-body": 22, - "brace-body/in-fallback": 16, - "top-level-resync": 345 + "top-level-resync": 371 } }, { @@ -1547,10 +1534,10 @@ "reason": "top-level drop-recovery discards tokens; parser reaches EOF so `parse` reports success (T42)", "issue": 1959, "expires": "2026-11-30", - "discard_tokens": 278, + "discard_tokens": 56, "discard_by_channel": { - "bdd-block-fallback": 203, - "brace-body/in-fallback": 75 + "bdd-block-fallback": 26, + "brace-body/in-fallback": 30 } }, {