From c19005d8f8084c3e7a4c0fa8e0ded5182ade2ca6 Mon Sep 17 00:00:00 2001 From: lab Date: Tue, 8 Sep 2026 11:38:17 +0700 Subject: [PATCH] gen-c: type a one-element literal list, from the field that holds it Refs #3459 334 of the remaining 837 `__auto_type x = { ... }` errors were one-element lists. The previous pass filed them rather than guessing: `[7]` arrives as an `ExprArrayLiteral` with ZERO children while the emitted C still reads `{ 7 }`, and `children` and `value` had both been searched and both were empty. The field is `extra_size`, and the comment naming it sits on the emitter arm FORTY LINES from the code that reads it: the parser stores the literal's ELEMENT TEXT in extra_size ("1,2,3" for a list, "0;4" for a repeat) with no children Two ends had to move together: the condition upstream still demanded non-empty `children`, and the declarator took its length from `children.len()`. Both now read `extra_size`, with the repeat form `v;n` taking `n` as the length rather than counting commas. MEASURED, whole corpus, -ferror-limit=0: errors 14276 -> 14165 __auto_type with initializer list 837 -> 670 files better 18 Two files rise and both are unmasking. Across two passes the class has gone 1729 -> 670. A MUTANT WAS BETTER THAN MY GUARD FOR ONE INPUT. Deleting the dotted-token check types `[1.2.3]` as `double x[1] = { 1.2.3 }` -- a malformed literal inside a well-formed declaration -- so the guard is load-bearing. But its first version required digits on BOTH sides of the dot, which refuses `1.`, and `1.` is valid C. The mutant exposed both halves at once: needed AND wrong. It now accepts at most one dot with digits on at least one side. `.5` is refused and stays refused: the lexer drops the leading dot and emits `{ 5 }`, so the value is corrupt before this code sees it, and typing a corrupted initialiser turns a loud error into a quiet wrong answer. The theoretical risk is named rather than hidden. A one-element list whose sole element is a QUOTED all-digit string, `["12"]`, is indistinguishable in `extra_size` from `[12]`, because the quotes are gone by then -- the old binary emitted `{ 12 }` too. Corpus population of that form: ZERO, measured, against 22 single-element string lists whose contents are not digits and which the inference refuses. Three mutants, three dead. 32 seals refreshed in the same commit. Co-Authored-By: Claude Opus 5 --- .trinity/seals/AdamW.json | 4 +- .trinity/seals/HSLM.json | 4 +- .trinity/seals/PhiSplitOptimality.json | 6 +- .trinity/seals/PositionalEncoding.json | 4 +- .trinity/seals/RTL.json | 4 +- .trinity/seals/SacredAttention.json | 4 +- .trinity/seals/SemanticSearch.json | 4 +- .trinity/seals/SgdMomentum.json | 4 +- .trinity/seals/VcdConformanceCompare.json | 4 +- .trinity/seals/coder_igla-coder-arch.json | 4 +- .../seals/coder_igla-coder-bench-proxy.json | 4 +- .../seals/coder_igla-coder-benchmark.json | 4 +- .trinity/seals/coder_igla-coder-eval.json | 4 +- .trinity/seals/coder_igla-coder-pipeline.json | 4 +- .../seals/coder_igla-coder-tokenizer.json | 4 +- .trinity/seals/coder_igla-coder-weights.json | 4 +- .../seals/fpga_VcdConformanceCompare.json | 4 +- .trinity/seals/math_PhiSplitOptimality.json | 4 +- .trinity/seals/memory_SemanticSearch.json | 4 +- .trinity/seals/nn_GatedLinearAttention.json | 4 +- .trinity/seals/nn_HSLM.json | 4 +- .trinity/seals/nn_SacredAttention.json | 4 +- .trinity/seals/optimizer_AdamW.json | 4 +- .trinity/seals/optimizer_SgdMomentum.json | 4 +- .../seals/race_igla-race-bram-weights.json | 4 +- .trinity/seals/race_igla-race-cordic-top.json | 4 +- .trinity/seals/race_igla-race-rtl.json | 4 +- .../race_igla-race-systolic-ternary.json | 4 +- .../seals/race_igla-race-ternary-dot-sw.json | 4 +- .../seals/race_igla-race-ternary-gemm.json | 4 +- .../seals/race_igla-race-ternary-mac.json | 4 +- .../seals/transformer_PositionalEncoding.json | 4 +- bootstrap/src/compiler.rs | 97 +++++++++++++++++-- bootstrap/stage0/FROZEN_HASH | 2 +- bootstrap/tests/c_literal_list_type.rs | 51 ++++++++++ ...nswer-was-in-a-comment-forty-lines-away.md | 9 ++ 36 files changed, 213 insertions(+), 76 deletions(-) create mode 100644 docs/now/2026-09-08-the-answer-was-in-a-comment-forty-lines-away.md diff --git a/.trinity/seals/AdamW.json b/.trinity/seals/AdamW.json index 6253f22802..dba510c7a1 100644 --- a/.trinity/seals/AdamW.json +++ b/.trinity/seals/AdamW.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:c79fd12f5b95994db62f3e42e7d8f898c4793f2cb5172f9ab2e4471893c57d5e", + "gen_hash_c": "sha256:3c6a1cd955da5f77eec7434fd848775038581dbc5561b77ed27dbd9be25f015d", "gen_hash_rust": "sha256:20969877473efdd38111fb8dba59cd02c5f11dfcdec7bccca52357d51e6474f5", "gen_hash_verilog": "sha256:b4c627e61a5f93624f5901ceb1386f761e68bb8ad1756fd90be8c727871f667c", "gen_hash_zig": "sha256:eaaca634bf317cb126fa1f126fa9c5171c9951cb2831d4a8a0cde5496c7c1a41", "module": "AdamW", "ring": 12, - "sealed_at": "2026-09-08T04:10:25Z", + "sealed_at": "2026-09-08T04:37:30Z", "spec_hash": "sha256:a5dbcb7030b094474aaaa271acb30a8e360843416a8ce98070bfee8cc66ae80b", "spec_path": "specs/ml/optimizer/adamw.t27" } \ No newline at end of file diff --git a/.trinity/seals/HSLM.json b/.trinity/seals/HSLM.json index 2b5f880c1e..b36501c9e4 100644 --- a/.trinity/seals/HSLM.json +++ b/.trinity/seals/HSLM.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:94ec1ab2d1eb93f81ca0f8a16625af4197bf13271ec9f104e766bc8db94b50ee", + "gen_hash_c": "sha256:f118f10a7540063794da9e1172f74d0ef27aeafb1b9c372fdd91181b5f13fab3", "gen_hash_rust": "sha256:77c0564db10be29afcc6dda0eab695afdb56acf295b08700ee82bbf58b457772", "gen_hash_verilog": "sha256:f8a956019cea253548cd3f3eee38d2405cea113b8ee5e66e3d387be41810c697", "gen_hash_zig": "sha256:51d88b507c315ec746ec177be352377540d8989ae03666f57d9db787201c57b9", "module": "HSLM", "ring": 12, - "sealed_at": "2026-09-08T04:10:25Z", + "sealed_at": "2026-09-08T04:37:30Z", "spec_hash": "sha256:8ea0766984db7775c474eab25dfb14965fa835ce0a56b33173df319fad342182", "spec_path": "specs/nn/hslm.t27" } \ No newline at end of file diff --git a/.trinity/seals/PhiSplitOptimality.json b/.trinity/seals/PhiSplitOptimality.json index b1d202c8f9..c0c4bbcb47 100644 --- a/.trinity/seals/PhiSplitOptimality.json +++ b/.trinity/seals/PhiSplitOptimality.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:4a7aea5ea8ecf04b1b977ad3e912903fb9aff98cae6e0f7e539560c41e77e908", + "gen_hash_c": "sha256:c921ddb95bf25515659c0e79809ba9ade07a0729ffe514b512fa66e8e9d6f9fa", "gen_hash_rust": "sha256:cde94088af5e2ee0c60273cf2e70fa5995617b00790d7427bff9408f2073c379", "gen_hash_verilog": "sha256:a7ca70e5b44760e4432a7fe9ab22c3b62dbb22735296358625b889e395bfdfc7", "gen_hash_zig": "sha256:8da93ead894c705a05ae364992a7df439087b2675b081b4d13a69b5b2299d6b1", "module": "PhiSplitOptimality", "ring": 12, - "sealed_at": "2026-08-28T21:20:51Z", + "sealed_at": "2026-09-08T04:37:30Z", "spec_hash": "sha256:c17f4eba133c5caccd5af0eb50c4ba920920ca361f8cb6cdcb8fcd4ac8a1e535", "spec_path": "specs/math/phi_split_optimality.t27" -} +} \ No newline at end of file diff --git a/.trinity/seals/PositionalEncoding.json b/.trinity/seals/PositionalEncoding.json index 5de81d1fb8..dde175011f 100644 --- a/.trinity/seals/PositionalEncoding.json +++ b/.trinity/seals/PositionalEncoding.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:eaaa7e5b78280b7ba9662d666ffa9de3429dd78cbae703d11c41b2cc7ade7d81", + "gen_hash_c": "sha256:6cb1076230055f82f9c6b3848109c7636a501aef318e51ca8c187f460f3576d2", "gen_hash_rust": "sha256:124b14e78bcbbd07e38a30bb0c428892871feb95945f330bae1ab9f4dd31ba9b", "gen_hash_verilog": "sha256:633093105b3880a9365a9de6d25007e45fcc018412f39492e6575f5c581014cf", "gen_hash_zig": "sha256:e0595ec599aa750f6c1ef97d8031bc1365383141df876731b8a3dc25ddf72244", "module": "PositionalEncoding", "ring": 12, - "sealed_at": "2026-09-08T04:10:25Z", + "sealed_at": "2026-09-08T04:37:30Z", "spec_hash": "sha256:22b7fd16cc3e23432ab550205a19de7e72f9f80efb73a000a1c9ce56b3c136b6", "spec_path": "specs/ml/transformer/positional_enc.t27" } \ No newline at end of file diff --git a/.trinity/seals/RTL.json b/.trinity/seals/RTL.json index c6293908cb..d007167eec 100644 --- a/.trinity/seals/RTL.json +++ b/.trinity/seals/RTL.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:fea3f17445eca057c936c73c6c4991956302f38a53472351ec39d5d0b8ca2af4", + "gen_hash_c": "sha256:32d54824b46cbd5baddf1f78a160a1b3ff42d71049cd732f33c22427b1eb5a52", "gen_hash_rust": "sha256:14e1c5cb3348b9e90558bce97218b8c5564af998d487148f0bebbc7366a86727", "gen_hash_verilog": "sha256:7247ec4c47b23b1e60b82ed743d2c03150a6ffc13d341b3c81fd25bc187cbc3e", "gen_hash_zig": "sha256:37b548cd1674b1938348d414f1858c5ff0615c8dc5d1c2ab751781293e2838be", "module": "RTL", "ring": 32, - "sealed_at": "2026-09-08T04:10:24Z", + "sealed_at": "2026-09-08T04:37:29Z", "spec_hash": "sha256:3ff776981a381a17cdd0b9ca87aecf18dbe50589013cf2291443ece1a597034d", "spec_path": "specs/igla/race/rtl.t27" } \ No newline at end of file diff --git a/.trinity/seals/SacredAttention.json b/.trinity/seals/SacredAttention.json index 51c48e5ea1..f5cf442aa0 100644 --- a/.trinity/seals/SacredAttention.json +++ b/.trinity/seals/SacredAttention.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:503a1168ff7d287b208e19b589abbf4b94bc0631262f3e8fe0d6a960886c192a", + "gen_hash_c": "sha256:3851ee7227a9ca38ee2f2d1d5061db2560f809effd509a9032d2d521202bcb4a", "gen_hash_rust": "sha256:0a4064c4d5ae45dda501198128042849e7b9f0b1b598012ddf8ff34367df1b72", "gen_hash_verilog": "sha256:495b48a5c98b7c1fccab460f017fcc48da428a1789ba23eaa7691edc1d0d9e13", "gen_hash_zig": "sha256:187bc0b9346fcc3d35ae53a9bad1be0fab2cfe59ddedbf8f61fe4a2856f4cd36", "module": "SacredAttention", "ring": 12, - "sealed_at": "2026-09-08T04:10:25Z", + "sealed_at": "2026-09-08T04:37:30Z", "spec_hash": "sha256:be83d2a916a15957502d6afa4d6eff7ab07d0373e81555704ee842500db47187", "spec_path": "specs/nn/attention.t27" } \ No newline at end of file diff --git a/.trinity/seals/SemanticSearch.json b/.trinity/seals/SemanticSearch.json index 11a0ce902e..4676690147 100644 --- a/.trinity/seals/SemanticSearch.json +++ b/.trinity/seals/SemanticSearch.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:a9880ebdb51408bb2d952994bfa9815df2ee2c35eb73d4b0aef5dd32a2db23f3", + "gen_hash_c": "sha256:c7f19cb6d5762d02670e5cf5a329f0812f533c68823423edf666b3bee83678c2", "gen_hash_rust": "sha256:bc9719a6aecfa4fa223008fcd185c323f5146d55e7b78855b751f1df87f0a2b8", "gen_hash_verilog": "sha256:b61c003f24955daa6eda2f075c52c3f38a1ae9febcd0aec01a197ee30c6582a0", "gen_hash_zig": "sha256:3ecedbf4e0cd2a1f0e1475fe00cf420f3bd6af6ada69ea53e60c0e4bc50bb463", "module": "SemanticSearch", "ring": 12, - "sealed_at": "2026-09-08T01:34:15Z", + "sealed_at": "2026-09-08T04:37:30Z", "spec_hash": "sha256:513b6a22de6436f9269e7422c67954b6836990fa5ddeb147df0c992e698e56ee", "spec_path": "specs/memory/semantic_search.t27" } \ No newline at end of file diff --git a/.trinity/seals/SgdMomentum.json b/.trinity/seals/SgdMomentum.json index c4b6622e93..32e3096203 100644 --- a/.trinity/seals/SgdMomentum.json +++ b/.trinity/seals/SgdMomentum.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:8ece0ef5238850fe98eb78d7e73090be3cfb2a6a194fa51eac8635f61b34d339", + "gen_hash_c": "sha256:5076df342ddd0880c649f10522ad0b05488fdc21347404764121c7f2a50d8539", "gen_hash_rust": "sha256:83d3c0a55ad8cb46923796f0b9441f467b8fe2bda86181873b0b722daa0ae78a", "gen_hash_verilog": "sha256:c2943fb3f229af3c139c76220c1763f884aba8049c1d5f478a97dd0e7cdba6ce", "gen_hash_zig": "sha256:8c7536f7a8d0c7d685d71d63135eb7a5186213f72662f457240341418e49b9ca", "module": "SgdMomentum", "ring": 12, - "sealed_at": "2026-09-08T04:10:25Z", + "sealed_at": "2026-09-08T04:37:30Z", "spec_hash": "sha256:e713662a43888a4304da49a3fa56934423615caec6edf983e2260fbb0123de3b", "spec_path": "specs/ml/optimizer/sgd_momentum.t27" } \ No newline at end of file diff --git a/.trinity/seals/VcdConformanceCompare.json b/.trinity/seals/VcdConformanceCompare.json index a4bc78e06f..4621acf31e 100644 --- a/.trinity/seals/VcdConformanceCompare.json +++ b/.trinity/seals/VcdConformanceCompare.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:9dfc1cf1ac4666678a60a03aa5314d272102e99b1eef2da16bc7c924836b0168", + "gen_hash_c": "sha256:6cbf3692bca3b50ff83707342f265ea76d0da7002a0ce2c30f1507657eb60910", "gen_hash_rust": "sha256:22abdfabfa3d5f9e9c58b9616ace0673862d8f6adcbaee237b4f9b0547d9e02c", "gen_hash_verilog": "sha256:80938ff974db8c15abfd968ee837482063894ee01947eeed90a43d37415e7515", "gen_hash_zig": "sha256:694c791d243ca858524d94f91fc59b26bcf839ba2a3455cce96548d841a6721f", "module": "VcdConformanceCompare", "ring": 12, - "sealed_at": "2026-09-08T04:10:23Z", + "sealed_at": "2026-09-08T04:37:28Z", "spec_hash": "sha256:59c9aed7248324467e2d13b458a60137da5b8b07f5116a484580f0dadc808cd8", "spec_path": "specs/fpga/vcd_conformance_compare.t27" } \ No newline at end of file diff --git a/.trinity/seals/coder_igla-coder-arch.json b/.trinity/seals/coder_igla-coder-arch.json index c068f9fabc..a805d97147 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:361285c3818e2380c42ebf51474b427b8232fec64764c6e32e61f101e50d882d", + "gen_hash_c": "sha256:6d1f61ba5f13852b2e278b97f07b58979d8a199d1555e8636a1513dbbe8fb71c", "gen_hash_rust": "sha256:d3e936ed770a65525ceb4be8fff81a1e7381f6915aa4b500f4b7626cc84c3606", "gen_hash_verilog": "sha256:68ee411594d2a8d1b0df9214fa06102bc4297f3d597e12fef90d8986b86670aa", "gen_hash_zig": "sha256:825537b84cf902a2b6ba0e18ce53cb4af39d117aefac808e3ecf8bae4cc09931", "module": "igla-coder-arch", "ring": 12, - "sealed_at": "2026-09-08T04:10:23Z", + "sealed_at": "2026-09-08T04:37:28Z", "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-bench-proxy.json b/.trinity/seals/coder_igla-coder-bench-proxy.json index bc1f4e3a64..db99abd7fc 100644 --- a/.trinity/seals/coder_igla-coder-bench-proxy.json +++ b/.trinity/seals/coder_igla-coder-bench-proxy.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:614716d434be2183b064cb3e63fb267d75744bfa63f25099c012817b96f883fa", + "gen_hash_c": "sha256:cd6d8524c7c21dad0d41d8ad91926c2842c04844aeaaafdcf5c3eeaae30c0f1b", "gen_hash_rust": "sha256:e9d666e31bb8a1d76846dfcdf3afcabba4d7119efed0f1b5f627277368e823af", "gen_hash_verilog": "sha256:1db729375b8a59f5e5abb2d657c7ca159423c02b501ad0b953b9fb7ca46bffb8", "gen_hash_zig": "sha256:506fc81ff04dc1c21f147dc026aefedf05e58d712c884361ee37c382ea64eb95", "module": "igla-coder-bench-proxy", "ring": 12, - "sealed_at": "2026-09-08T04:10:23Z", + "sealed_at": "2026-09-08T04:37:28Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:340aeb11e95050b8aab5c127f136ccb0d04be9e650f664c5a13db07feba0d70d", "spec_path": "specs/igla/coder/bench_proxy.t27" diff --git a/.trinity/seals/coder_igla-coder-benchmark.json b/.trinity/seals/coder_igla-coder-benchmark.json index a6d256e959..c87ce9189f 100644 --- a/.trinity/seals/coder_igla-coder-benchmark.json +++ b/.trinity/seals/coder_igla-coder-benchmark.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:75baf4a4552e49ed8a118ead405e821b804e3599e4b5ad572a07b720892d3b13", + "gen_hash_c": "sha256:d3139d185b05749b066ab0a43ee7e3ae9c1c9a6f7ebed05dac4f1708f4eb96b1", "gen_hash_rust": "sha256:97b21ecd83ea15564c7976d865213f0dd17a5a521b6061efb9b77aed77d389a6", "gen_hash_verilog": "sha256:c39a2fe88cbbd3e877c7818e32c3a498c919102b395b35b35bda8835b4efa120", "gen_hash_zig": "sha256:c5737ad94fa6ae7cea4f66ee0c80746a56a2d2787b8c661e01309735df96047e", "module": "igla-coder-benchmark", "ring": 12, - "sealed_at": "2026-09-08T04:10:23Z", + "sealed_at": "2026-09-08T04:37:28Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:364fcad4e84a7bc2b862ef2c3845af3877da670806960f9fe845b47bffa7f641", "spec_path": "specs/igla/coder/benchmark.t27" diff --git a/.trinity/seals/coder_igla-coder-eval.json b/.trinity/seals/coder_igla-coder-eval.json index 83ea050aba..482a3e669e 100644 --- a/.trinity/seals/coder_igla-coder-eval.json +++ b/.trinity/seals/coder_igla-coder-eval.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:2d7aa7d81a5c98d8443bbd4c04ced55855a63482018cd4d71e1d063273c67199", + "gen_hash_c": "sha256:5381b4a938de64d6fb921d438690d110e7aa84c60d481eb1760b6f55a3ba8d6a", "gen_hash_rust": "sha256:d9897ffea08685af7c1f7278356d9c8b9818ef051bdb46a699d6f911fd798776", "gen_hash_verilog": "sha256:26e15c2e2e2a89bc9fbb19be86dd960c950518c4b1a57385d5ca00c5531ebd31", "gen_hash_zig": "sha256:cc88c2b3a66f72b4491ffd56e413105f1ad979ef04bf170c5cf202e46a863d6e", "module": "igla-coder-eval", "ring": 12, - "sealed_at": "2026-09-08T04:10:23Z", + "sealed_at": "2026-09-08T04:37:29Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:665636a59b59cca6f3255f7271f7507e4c49135f2c7c0d08310f3ef1e1ac708b", "spec_path": "specs/igla/coder/eval.t27" diff --git a/.trinity/seals/coder_igla-coder-pipeline.json b/.trinity/seals/coder_igla-coder-pipeline.json index 45232478cc..034a585f4c 100644 --- a/.trinity/seals/coder_igla-coder-pipeline.json +++ b/.trinity/seals/coder_igla-coder-pipeline.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:7d1e0886fbdac99b384952edb840e208c0d45bab3a0e26d580411f87b93e38d8", + "gen_hash_c": "sha256:dc87d791e1a6b20950e3d4d46e99780018c6f718edc6888c4446d86ab830c895", "gen_hash_rust": "sha256:4a2fdde88384921ce6b7a29fbbbec98f3b5d4219f925dc761da9e5e14e146a8a", "gen_hash_verilog": "sha256:bb9ad9011f231784af5067aa70cd17ed4e0784000ef43d1d7381a5ce489c5982", "gen_hash_zig": "sha256:3e2a4690e81c39423645f96deb48beee2712ad92105e10e3585f2c5c76c7df08", "module": "igla-coder-pipeline", "ring": 12, - "sealed_at": "2026-09-08T04:10:24Z", + "sealed_at": "2026-09-08T04:37:29Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:304354cec12b7541a1cb98377c1f9e0f6e466d5a4d9e858e883039888957d206", "spec_path": "specs/igla/coder/pipeline.t27" diff --git a/.trinity/seals/coder_igla-coder-tokenizer.json b/.trinity/seals/coder_igla-coder-tokenizer.json index 9e3b7bf7c7..d6c38f7845 100644 --- a/.trinity/seals/coder_igla-coder-tokenizer.json +++ b/.trinity/seals/coder_igla-coder-tokenizer.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:1b18f703b1916af13bb27d7269bf40bde7d65918cdde1d41a8375060f5d5bcaa", + "gen_hash_c": "sha256:b33b18a48f83509131f3a10e44b6ea5c648981cfeb3a764ac8940dbed06dd76f", "gen_hash_rust": "sha256:3a36615aec0781f5532bf7fee077186dc0e63847ada80a0b938d8ead9152ea3f", "gen_hash_verilog": "sha256:38666d3626e908227181bbaa29ebbcecc2d98f739c75229d8a3cc460b27477c3", "gen_hash_zig": "sha256:9d639a3601232366f843a640a397238b405a27625790c37fda4a252de5f71074", "module": "igla-coder-tokenizer", "ring": 12, - "sealed_at": "2026-09-08T04:10:24Z", + "sealed_at": "2026-09-08T04:37:29Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:7647d8e3c93c634aeac4875d61712fcacff2f3a31b3b778a0cc1167d1e31ae8a", "spec_path": "specs/igla/coder/tokenizer.t27" diff --git a/.trinity/seals/coder_igla-coder-weights.json b/.trinity/seals/coder_igla-coder-weights.json index e682021e62..ab016139bd 100644 --- a/.trinity/seals/coder_igla-coder-weights.json +++ b/.trinity/seals/coder_igla-coder-weights.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:574cd1dc9b338b3b21bbda31d94fbe605da46f9c379bcff061316bd843411dd7", + "gen_hash_c": "sha256:381c56933b8859e970e6ec775035b356eaa68ac563c49d7b9837c633f9785909", "gen_hash_rust": "sha256:33028fe7950ecf94098c0b646afee6d324de45d530abee909a89d273cae5e575", "gen_hash_verilog": "sha256:ccc961fff14fad2aa0ab657787fbc8ba97deacf803244f5c641daa16dc40cb99", "gen_hash_zig": "sha256:86ac85e41d346513903952c15bc89ea9cb18764e14106bc6fa4a19050ebbf132", "module": "igla-coder-weights", "ring": 12, - "sealed_at": "2026-09-08T04:10:24Z", + "sealed_at": "2026-09-08T04:37:29Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:d01f671df7e6cd43c5337cec36c44cc3f074a3a6c8b9a3010806111197cc378d", "spec_path": "specs/igla/coder/weights.t27" diff --git a/.trinity/seals/fpga_VcdConformanceCompare.json b/.trinity/seals/fpga_VcdConformanceCompare.json index 6bcf0534b0..73d2b1ceed 100644 --- a/.trinity/seals/fpga_VcdConformanceCompare.json +++ b/.trinity/seals/fpga_VcdConformanceCompare.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:9dfc1cf1ac4666678a60a03aa5314d272102e99b1eef2da16bc7c924836b0168", + "gen_hash_c": "sha256:6cbf3692bca3b50ff83707342f265ea76d0da7002a0ce2c30f1507657eb60910", "gen_hash_rust": "sha256:22abdfabfa3d5f9e9c58b9616ace0673862d8f6adcbaee237b4f9b0547d9e02c", "gen_hash_verilog": "sha256:80938ff974db8c15abfd968ee837482063894ee01947eeed90a43d37415e7515", "gen_hash_zig": "sha256:694c791d243ca858524d94f91fc59b26bcf839ba2a3455cce96548d841a6721f", "module": "VcdConformanceCompare", "ring": 12, - "sealed_at": "2026-09-08T04:10:23Z", + "sealed_at": "2026-09-08T04:37:28Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:59c9aed7248324467e2d13b458a60137da5b8b07f5116a484580f0dadc808cd8", "spec_path": "specs/fpga/vcd_conformance_compare.t27" diff --git a/.trinity/seals/math_PhiSplitOptimality.json b/.trinity/seals/math_PhiSplitOptimality.json index 130e38b48f..d5088c7145 100644 --- a/.trinity/seals/math_PhiSplitOptimality.json +++ b/.trinity/seals/math_PhiSplitOptimality.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:4a7aea5ea8ecf04b1b977ad3e912903fb9aff98cae6e0f7e539560c41e77e908", + "gen_hash_c": "sha256:c921ddb95bf25515659c0e79809ba9ade07a0729ffe514b512fa66e8e9d6f9fa", "gen_hash_rust": "sha256:cde94088af5e2ee0c60273cf2e70fa5995617b00790d7427bff9408f2073c379", "gen_hash_verilog": "sha256:a7ca70e5b44760e4432a7fe9ab22c3b62dbb22735296358625b889e395bfdfc7", "gen_hash_zig": "sha256:8da93ead894c705a05ae364992a7df439087b2675b081b4d13a69b5b2299d6b1", "module": "PhiSplitOptimality", "ring": 12, - "sealed_at": "2026-09-06T04:36:44Z", + "sealed_at": "2026-09-08T04:37:30Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:c17f4eba133c5caccd5af0eb50c4ba920920ca361f8cb6cdcb8fcd4ac8a1e535", "spec_path": "specs/math/phi_split_optimality.t27" diff --git a/.trinity/seals/memory_SemanticSearch.json b/.trinity/seals/memory_SemanticSearch.json index 0a8dd339fb..a5efb847c7 100644 --- a/.trinity/seals/memory_SemanticSearch.json +++ b/.trinity/seals/memory_SemanticSearch.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:a9880ebdb51408bb2d952994bfa9815df2ee2c35eb73d4b0aef5dd32a2db23f3", + "gen_hash_c": "sha256:c7f19cb6d5762d02670e5cf5a329f0812f533c68823423edf666b3bee83678c2", "gen_hash_rust": "sha256:bc9719a6aecfa4fa223008fcd185c323f5146d55e7b78855b751f1df87f0a2b8", "gen_hash_verilog": "sha256:b61c003f24955daa6eda2f075c52c3f38a1ae9febcd0aec01a197ee30c6582a0", "gen_hash_zig": "sha256:3ecedbf4e0cd2a1f0e1475fe00cf420f3bd6af6ada69ea53e60c0e4bc50bb463", "module": "SemanticSearch", "ring": 12, - "sealed_at": "2026-09-08T01:34:15Z", + "sealed_at": "2026-09-08T04:37:30Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:513b6a22de6436f9269e7422c67954b6836990fa5ddeb147df0c992e698e56ee", "spec_path": "specs/memory/semantic_search.t27" diff --git a/.trinity/seals/nn_GatedLinearAttention.json b/.trinity/seals/nn_GatedLinearAttention.json index 998f99b226..68e74ea1d7 100644 --- a/.trinity/seals/nn_GatedLinearAttention.json +++ b/.trinity/seals/nn_GatedLinearAttention.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:0344af2516fd752043d9a5b4ab46cadb8aa26f92fd17468d1002f56ec8001c5a", + "gen_hash_c": "sha256:68464814a50929e594bed11c129ef79f45c0dde0ad20cc80effe32197a089eb5", "gen_hash_rust": "sha256:d1757f40cd640b9bf9972c98be121986bea2e7b091186e875520e556f3217e14", "gen_hash_verilog": "sha256:112cbe0bb8e1936e213bbacb14d084dfd3730661dde5b43b12870b2ad2092c1f", "gen_hash_zig": "sha256:f4769fec50bf2bf0bca08e4d8d2080dffafa73ec7ab29f80c8c95b83d6ecdaa9", "module": "GatedLinearAttention", "ring": 12, - "sealed_at": "2026-09-08T04:10:25Z", + "sealed_at": "2026-09-08T04:37:30Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:004529e85abd9c48919785e32e065358c561574356ddff82ef9bdf5c387fa195", "spec_path": "specs/nn/gla.t27" diff --git a/.trinity/seals/nn_HSLM.json b/.trinity/seals/nn_HSLM.json index ea7eed8dc2..d2ffcd96eb 100644 --- a/.trinity/seals/nn_HSLM.json +++ b/.trinity/seals/nn_HSLM.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:94ec1ab2d1eb93f81ca0f8a16625af4197bf13271ec9f104e766bc8db94b50ee", + "gen_hash_c": "sha256:f118f10a7540063794da9e1172f74d0ef27aeafb1b9c372fdd91181b5f13fab3", "gen_hash_rust": "sha256:77c0564db10be29afcc6dda0eab695afdb56acf295b08700ee82bbf58b457772", "gen_hash_verilog": "sha256:f8a956019cea253548cd3f3eee38d2405cea113b8ee5e66e3d387be41810c697", "gen_hash_zig": "sha256:51d88b507c315ec746ec177be352377540d8989ae03666f57d9db787201c57b9", "module": "HSLM", "ring": 12, - "sealed_at": "2026-09-08T04:10:25Z", + "sealed_at": "2026-09-08T04:37:30Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:8ea0766984db7775c474eab25dfb14965fa835ce0a56b33173df319fad342182", "spec_path": "specs/nn/hslm.t27" diff --git a/.trinity/seals/nn_SacredAttention.json b/.trinity/seals/nn_SacredAttention.json index 01a4858068..140025a741 100644 --- a/.trinity/seals/nn_SacredAttention.json +++ b/.trinity/seals/nn_SacredAttention.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:503a1168ff7d287b208e19b589abbf4b94bc0631262f3e8fe0d6a960886c192a", + "gen_hash_c": "sha256:3851ee7227a9ca38ee2f2d1d5061db2560f809effd509a9032d2d521202bcb4a", "gen_hash_rust": "sha256:0a4064c4d5ae45dda501198128042849e7b9f0b1b598012ddf8ff34367df1b72", "gen_hash_verilog": "sha256:495b48a5c98b7c1fccab460f017fcc48da428a1789ba23eaa7691edc1d0d9e13", "gen_hash_zig": "sha256:187bc0b9346fcc3d35ae53a9bad1be0fab2cfe59ddedbf8f61fe4a2856f4cd36", "module": "SacredAttention", "ring": 12, - "sealed_at": "2026-09-08T04:10:25Z", + "sealed_at": "2026-09-08T04:37:30Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:be83d2a916a15957502d6afa4d6eff7ab07d0373e81555704ee842500db47187", "spec_path": "specs/nn/attention.t27" diff --git a/.trinity/seals/optimizer_AdamW.json b/.trinity/seals/optimizer_AdamW.json index 4a6d810575..e9c3acc38d 100644 --- a/.trinity/seals/optimizer_AdamW.json +++ b/.trinity/seals/optimizer_AdamW.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:c79fd12f5b95994db62f3e42e7d8f898c4793f2cb5172f9ab2e4471893c57d5e", + "gen_hash_c": "sha256:3c6a1cd955da5f77eec7434fd848775038581dbc5561b77ed27dbd9be25f015d", "gen_hash_rust": "sha256:20969877473efdd38111fb8dba59cd02c5f11dfcdec7bccca52357d51e6474f5", "gen_hash_verilog": "sha256:b4c627e61a5f93624f5901ceb1386f761e68bb8ad1756fd90be8c727871f667c", "gen_hash_zig": "sha256:eaaca634bf317cb126fa1f126fa9c5171c9951cb2831d4a8a0cde5496c7c1a41", "module": "AdamW", "ring": 12, - "sealed_at": "2026-09-08T04:10:25Z", + "sealed_at": "2026-09-08T04:37:30Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:a5dbcb7030b094474aaaa271acb30a8e360843416a8ce98070bfee8cc66ae80b", "spec_path": "specs/ml/optimizer/adamw.t27" diff --git a/.trinity/seals/optimizer_SgdMomentum.json b/.trinity/seals/optimizer_SgdMomentum.json index 4700d78477..5e87725651 100644 --- a/.trinity/seals/optimizer_SgdMomentum.json +++ b/.trinity/seals/optimizer_SgdMomentum.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:8ece0ef5238850fe98eb78d7e73090be3cfb2a6a194fa51eac8635f61b34d339", + "gen_hash_c": "sha256:5076df342ddd0880c649f10522ad0b05488fdc21347404764121c7f2a50d8539", "gen_hash_rust": "sha256:83d3c0a55ad8cb46923796f0b9441f467b8fe2bda86181873b0b722daa0ae78a", "gen_hash_verilog": "sha256:c2943fb3f229af3c139c76220c1763f884aba8049c1d5f478a97dd0e7cdba6ce", "gen_hash_zig": "sha256:8c7536f7a8d0c7d685d71d63135eb7a5186213f72662f457240341418e49b9ca", "module": "SgdMomentum", "ring": 12, - "sealed_at": "2026-09-08T04:10:25Z", + "sealed_at": "2026-09-08T04:37:30Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:e713662a43888a4304da49a3fa56934423615caec6edf983e2260fbb0123de3b", "spec_path": "specs/ml/optimizer/sgd_momentum.t27" diff --git a/.trinity/seals/race_igla-race-bram-weights.json b/.trinity/seals/race_igla-race-bram-weights.json index 2fd78e24d8..8c0f27ce25 100644 --- a/.trinity/seals/race_igla-race-bram-weights.json +++ b/.trinity/seals/race_igla-race-bram-weights.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:e331fc299e21653e4e25fe996aa9944ea380b195fcc1b6fb458480ee95b66d6f", + "gen_hash_c": "sha256:8640ff3f6434e702e053b558a0418fb887588d167df45ef0daf3b8a6b1deeb88", "gen_hash_rust": "sha256:f63fd7d8db65f01d0f2488f59eff739db46ccd30bf5ac07f8c92959180e8f62e", "gen_hash_verilog": "sha256:c8244a6bc32c81b542d5739c4e03cced0f0e0e50e3267c217e4283d66f0dc941", "gen_hash_zig": "sha256:0eb407b316000867cd5b3d45da1d26b9d86198a1b3cb7b6df0b9525370120afa", "module": "igla-race-bram-weights", "ring": 12, - "sealed_at": "2026-09-08T04:10:24Z", + "sealed_at": "2026-09-08T04:37:29Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:d004effd79bb25726237a52ec4b3edb1ff89373b35f73d1b7aecd002afb33432", "spec_path": "specs/igla/race/bram_weights.t27" diff --git a/.trinity/seals/race_igla-race-cordic-top.json b/.trinity/seals/race_igla-race-cordic-top.json index bc1683cd32..e8b52ca5ac 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:88a8dcd169c639c7a0a20a03bf2542c713bc638b42c394d23089fa11e46fac6d", + "gen_hash_c": "sha256:28f2e68d766c05a5e90abae6cb07231879cedee3b4d1ddd162ccb52ed6fd3e14", "gen_hash_rust": "sha256:b876f8b4ecc224ee66bf46d2c1e2086eb495213585ad0fc9cae7b91d15163a2a", "gen_hash_verilog": "sha256:71e302e9cd7c97dc75ce1efb99eb99d151af660091b71d8656ea3c7dd618227e", "gen_hash_zig": "sha256:bbb8624c7b7bcc7e26cc3e96548573ef6c1b04c0bb6cb7b1a2e2eee7f0ea9e8b", "module": "igla-race-cordic-top", "ring": 12, - "sealed_at": "2026-09-08T04:10:24Z", + "sealed_at": "2026-09-08T04:37:29Z", "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-rtl.json b/.trinity/seals/race_igla-race-rtl.json index dc8238543d..e367628ffc 100644 --- a/.trinity/seals/race_igla-race-rtl.json +++ b/.trinity/seals/race_igla-race-rtl.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:fea3f17445eca057c936c73c6c4991956302f38a53472351ec39d5d0b8ca2af4", + "gen_hash_c": "sha256:32d54824b46cbd5baddf1f78a160a1b3ff42d71049cd732f33c22427b1eb5a52", "gen_hash_rust": "sha256:14e1c5cb3348b9e90558bce97218b8c5564af998d487148f0bebbc7366a86727", "gen_hash_verilog": "sha256:7247ec4c47b23b1e60b82ed743d2c03150a6ffc13d341b3c81fd25bc187cbc3e", "gen_hash_zig": "sha256:37b548cd1674b1938348d414f1858c5ff0615c8dc5d1c2ab751781293e2838be", "module": "igla-race-rtl", "ring": 12, - "sealed_at": "2026-09-08T04:10:24Z", + "sealed_at": "2026-09-08T04:37:29Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:3ff776981a381a17cdd0b9ca87aecf18dbe50589013cf2291443ece1a597034d", "spec_path": "specs/igla/race/rtl.t27" diff --git a/.trinity/seals/race_igla-race-systolic-ternary.json b/.trinity/seals/race_igla-race-systolic-ternary.json index 9ebe7a3e70..4a6b196807 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:4fbb5bdf305e8a345c78fdcbca89a45d2e952716a273d50cf6d097361e82cd3c", + "gen_hash_c": "sha256:df7bfe97004df59745df797a4f4ea7ecf5e7b59143402688adcac392257a96e7", "gen_hash_rust": "sha256:dbc34c6545d36d0c1aa284398f8c87a22d27f9f67ca1ff1190d2083351f422cb", "gen_hash_verilog": "sha256:29244ceb3b49d238c23d8cf1f3283599058ca8953158e58b7f3d1a58692dc8b5", "gen_hash_zig": "sha256:e74bb53517a9458208fbafb2b0a3e9af0a1b67992869d2033eddd122ad34301b", "module": "igla-race-systolic-ternary", "ring": 12, - "sealed_at": "2026-09-08T04:10:24Z", + "sealed_at": "2026-09-08T04:37:29Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:968bea4fd52e44b99e900e9ae7b6e1642783a98413791edae61f450d59ead18f", "spec_path": "specs/igla/race/systolic_ternary.t27" diff --git a/.trinity/seals/race_igla-race-ternary-dot-sw.json b/.trinity/seals/race_igla-race-ternary-dot-sw.json index 719451ec1a..a7cab72138 100644 --- a/.trinity/seals/race_igla-race-ternary-dot-sw.json +++ b/.trinity/seals/race_igla-race-ternary-dot-sw.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:ccf5594abff6eeb3c2910adde924106c289ed8a9b557f5938dd4313fd5dbc10b", + "gen_hash_c": "sha256:401e11636ca7d362b1f6e2c243c5f04e88dc0ba3a5e2aa560c6483dc5516e069", "gen_hash_rust": "sha256:1df4da3d70d612e7cfa8445dfbc8eeafbc8cb5f6c482a0055fbfc2a583745d26", "gen_hash_verilog": "sha256:67020e89dacb3b31e5b17fdf79d8b032131a1d74964886c2e51700e05677bd9a", "gen_hash_zig": "sha256:9ccb3f4be33392ab07fe1caf6e614a147ade4b7829e6db5e00eae9f81a8a1627", "module": "igla-race-ternary-dot-sw", "ring": 12, - "sealed_at": "2026-09-08T04:10:24Z", + "sealed_at": "2026-09-08T04:37:29Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:5bf4a9567cd56ec9b8862707948c207bba85498d272b73b0fc53e20aa548cbb7", "spec_path": "specs/igla/race/ternary_dot_sw.t27" diff --git a/.trinity/seals/race_igla-race-ternary-gemm.json b/.trinity/seals/race_igla-race-ternary-gemm.json index c6bd5a887c..4773d66b1d 100644 --- a/.trinity/seals/race_igla-race-ternary-gemm.json +++ b/.trinity/seals/race_igla-race-ternary-gemm.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:7ba1e0fe60704ef0f052b28f498b120ea3e41561f05ca56d114d6d6f72a5b022", + "gen_hash_c": "sha256:d84ce4baf496f43fc1c392092f606b7d2b1352deb809de035cad86343a48b2c4", "gen_hash_rust": "sha256:e21acf29d54c8453043438495d6416747fece0299271fe66a734d2b58e181786", "gen_hash_verilog": "sha256:5b75c2bfeea653bf96764b4709b5d0f6dbaf317c1d22352b67bb29c32da2304c", "gen_hash_zig": "sha256:edafb992971106619c0a55daa802154b4fbc2f24691078d7a5c35a7c976c9bfe", "module": "igla-race-ternary-gemm", "ring": 12, - "sealed_at": "2026-09-08T04:10:25Z", + "sealed_at": "2026-09-08T04:37:30Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:78a24a2432a4f2b0d6d042140db3ad42e9f7cc795beb5959c7acee807d83e2f4", "spec_path": "specs/igla/race/ternary_gemm.t27" diff --git a/.trinity/seals/race_igla-race-ternary-mac.json b/.trinity/seals/race_igla-race-ternary-mac.json index 3abbf6af53..c76974a967 100644 --- a/.trinity/seals/race_igla-race-ternary-mac.json +++ b/.trinity/seals/race_igla-race-ternary-mac.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:4c1bcde2480a4c5cc72d842c76fad7d775276fbc3a070b94958b3fd6bc151c8d", + "gen_hash_c": "sha256:398f58168a92672ab0593e7734ee0677deb013a3ca01746550dd84ee1686454a", "gen_hash_rust": "sha256:90ff69f87239df32cfc8605b00f86c36274fe57f800f410e9f67bba6b6a69534", "gen_hash_verilog": "sha256:b7a02eb7d7dadcd739254a928c1c0b9debfa911792abfe61ec77cf9a276da22f", "gen_hash_zig": "sha256:8b1897fdf2be962713d1be10f8ac0c9e2d63e234fc659ac92ad110df3d39db0b", "module": "igla-race-ternary-mac", "ring": 12, - "sealed_at": "2026-09-08T04:10:25Z", + "sealed_at": "2026-09-08T04:37:30Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:da088b364da904b38f48394a0c471089133d86e7035315c7dc9bae189f05d4dd", "spec_path": "specs/igla/race/ternary_mac.t27" diff --git a/.trinity/seals/transformer_PositionalEncoding.json b/.trinity/seals/transformer_PositionalEncoding.json index 19e96d8272..dbbe89b960 100644 --- a/.trinity/seals/transformer_PositionalEncoding.json +++ b/.trinity/seals/transformer_PositionalEncoding.json @@ -1,11 +1,11 @@ { - "gen_hash_c": "sha256:eaaa7e5b78280b7ba9662d666ffa9de3429dd78cbae703d11c41b2cc7ade7d81", + "gen_hash_c": "sha256:6cb1076230055f82f9c6b3848109c7636a501aef318e51ca8c187f460f3576d2", "gen_hash_rust": "sha256:124b14e78bcbbd07e38a30bb0c428892871feb95945f330bae1ab9f4dd31ba9b", "gen_hash_verilog": "sha256:633093105b3880a9365a9de6d25007e45fcc018412f39492e6575f5c581014cf", "gen_hash_zig": "sha256:e0595ec599aa750f6c1ef97d8031bc1365383141df876731b8a3dc25ddf72244", "module": "PositionalEncoding", "ring": 12, - "sealed_at": "2026-09-08T04:10:25Z", + "sealed_at": "2026-09-08T04:37:30Z", "sealed_by": "t27c-bootstrap@0.2.0", "spec_hash": "sha256:22b7fd16cc3e23432ab550205a19de7e72f9f80efb73a000a1c9ce56b3c136b6", "spec_path": "specs/ml/transformer/positional_enc.t27" diff --git a/bootstrap/src/compiler.rs b/bootstrap/src/compiler.rs index 4d0cceeac4..c050dba4c5 100644 --- a/bootstrap/src/compiler.rs +++ b/bootstrap/src/compiler.rs @@ -19326,6 +19326,28 @@ impl CCodegen { Some(format!("{}{} {}[]", qual, Self::type_to_c(elem), name)) } + /// How many elements a bare array literal has, when the parser kept them + /// in `extra_size` rather than in `children`. + /// + /// `"1,2,3"` is three; `"0;4"` is the repeat form and is four. Returns None + /// for anything it cannot count, so the declarator is never given a length + /// this did not derive. + fn c_literal_list_len(lit: &Node) -> Option { + let text = lit.extra_size.trim(); + if text.is_empty() { + return None; + } + if let Some((_, n)) = text.split_once(';') { + return n.trim().parse::().ok().filter(|n| *n > 0); + } + let n = text.split(',').filter(|p| !p.trim().is_empty()).count(); + if n == 0 { + None + } else { + Some(n) + } + } + /// The element type of an array literal whose elements are all numeric /// literals, or None. /// @@ -19344,16 +19366,62 @@ impl CCodegen { /// numeric literal -- a call such as `cast_i8(1)` has a return type this /// does not read, and guessing one would be worse than `__auto_type`. fn c_literal_list_elem(lit: &Node) -> Option { - // A ONE-element literal is NOT handled and the reason is written down - // rather than guessed at: `[7]` arrives as an `ExprArrayLiteral` with - // ZERO children -- confirmed by instrumenting this branch -- while the - // emitted C still reads `{ 7 }`, so the element is kept somewhere this - // does not read. `lit.value` was the obvious candidate and is empty - // too; that was tried and reverted. 334 of the remaining class are - // `{ 0 }` and every one takes that path. Filed rather than guessed. - if lit.kind != NodeKind::ExprArrayLiteral || lit.children.is_empty() { + if lit.kind != NodeKind::ExprArrayLiteral { return None; } + // The answer was written on the emitter arm all along: "the parser + // stores the literal's ELEMENT TEXT in extra_size ("1,2,3" for a list, + // "0;4" for a repeat) with no children". `children` and `value` were + // both searched and both empty; the field is `extra_size`, and the + // comment naming it sits forty lines from the code that reads it. + // + // 334 of the remaining class are `{ 0 }` and every one arrives this + // way. + if lit.children.is_empty() { + let text = lit.extra_size.trim(); + if text.is_empty() { + return None; + } + // The repeat form `[v; n]`: the element is the part before `;`. + let head = text.split(';').next().unwrap_or("").trim(); + let items: Vec<&str> = if text.contains(';') { + vec![head] + } else { + text.split(',').map(str::trim).collect() + }; + if items.is_empty() { + return None; + } + let mut any_float = false; + for v in items { + if v.is_empty() { + return None; + } + let body = v.strip_prefix('-').unwrap_or(v); + if body.contains('.') { + // A C floating literal: AT MOST ONE dot, and at least one + // digit. `a.b` is a field access, `1.2.3` is not a number + // at all -- both refused. `1.` and `.5` ARE valid C and are + // accepted; requiring digits on both sides of the dot + // refused them, which a mutant on this line exposed by + // being BETTER than the guard for those two inputs. + let mut parts = body.split('.'); + let head = parts.next().unwrap_or(""); + let tail = parts.next().unwrap_or(""); + if parts.next().is_some() { + return None; + } + let digits = |t: &str| t.chars().all(|c| c.is_ascii_digit()); + if !digits(head) || !digits(tail) || (head.is_empty() && tail.is_empty()) { + return None; + } + any_float = true; + } else if !body.chars().all(|c| c.is_ascii_digit() || c == '_') { + return None; + } + } + return Some(if any_float { "f64" } else { "u32" }.to_string()); + } let mut any_float = false; for e in &lit.children { // SUBSUMED TODAY, and kept deliberately. A mutant deleting this @@ -20011,7 +20079,11 @@ impl CCodegen { .first() .is_some_and(|c| { c.kind == NodeKind::ExprArrayLiteral - && !c.children.is_empty() + // Not `!children.is_empty()`: the parser keeps + // a bare list's elements in `extra_size` and + // leaves `children` EMPTY, which is why every + // `{ 0 }` was still reaching `__auto_type`. + && (!c.children.is_empty() || !c.extra_size.trim().is_empty()) // The literal's own element type when it has // one, and otherwise the type of its first // element if that is a struct literal -- @@ -20055,7 +20127,12 @@ impl CCodegen { // custom type through unchanged, which is what a struct // name needs anyway. let c_elem = Self::type_to_c(&elem).to_string(); - self.write(&format!("{} {}[{}]", c_elem, node.name, lit.children.len())); + let n = if lit.children.is_empty() { + Self::c_literal_list_len(lit).unwrap_or(0) + } else { + lit.children.len() + }; + self.write(&format!("{} {}[{}]", c_elem, node.name, n)); } else { let inferred_arr = if raw_type.is_empty() { node.children diff --git a/bootstrap/stage0/FROZEN_HASH b/bootstrap/stage0/FROZEN_HASH index fb3c9db661..22920dec1a 100644 --- a/bootstrap/stage0/FROZEN_HASH +++ b/bootstrap/stage0/FROZEN_HASH @@ -1 +1 @@ -1515e2cbfd015d433e618ed6efb0539ea5de76d5579b0d65af1681ea109b2055 bootstrap/src/compiler.rs +6e4a6550acfafca3d62c48680b3b96f1532914deb976c7fb102ed338e460c5bd bootstrap/src/compiler.rs diff --git a/bootstrap/tests/c_literal_list_type.rs b/bootstrap/tests/c_literal_list_type.rs index 6fcf906a0e..f6d813f44f 100644 --- a/bootstrap/tests/c_literal_list_type.rs +++ b/bootstrap/tests/c_literal_list_type.rs @@ -111,3 +111,54 @@ fn an_annotated_list_is_unchanged() { assert!(!errors(&h, &d).contains("error"), "and it compiles"); } } + +#[test] +fn a_one_element_list_is_typed_too() { + // The parser keeps a BARE list's elements in `extra_size` and leaves + // `children` empty -- stated in a comment on the emitter arm, forty lines + // from the code that reads it, and found only after `children` and + // `value` had both been searched and both come back empty. + // + // 334 of the remaining class were `{ 0 }` and every one arrived this way. + for (body, want) in [ + ("var x = [7];", "uint32_t x[1] = { 7 };"), + ("var x = [0];", "uint32_t x[1] = { 0 };"), + ("var x = [1.5];", "double x[1] = { 1.5 };"), + ] { + let (h, d) = gen_c(body, "one"); + assert!(h.contains(want), "for `{body}` expected `{want}`:\n{h}"); + if cc_present() { + assert!(!errors(&h, &d).contains("error"), "and `{body}` must compile"); + } + } +} + +#[test] +fn the_repeat_form_takes_its_length_from_the_count() { + // `[0; 4]` arrives as `extra_size` "0;4": the element is before the + // semicolon and the LENGTH after it, not the number of commas. + let (h, d) = gen_c("var x = [0; 4];", "repeat"); + assert!(h.contains("uint32_t x[4] ="), "the repeat count is the length:\n{h}"); + if cc_present() { + assert!(!errors(&h, &d).contains("error"), "and it compiles"); + } +} + +#[test] +fn a_dotted_token_is_a_float_only_when_it_is_one() { + // The mutant that exposed both halves of this. Deleting the shape check + // types `[1.2.3]` as `double x[1] = { 1.2.3 }` -- a malformed C literal in + // a well-formed declaration. And the FIRST version of the check, requiring + // digits on both sides of the dot, refused `1.`, which IS valid C: the + // mutant was better than the guard for that input. + for (body, tag) in [("var x = [1.2.3];", "three"), ("var a = 1; var x = [a.b];", "field")] { + let (h, _d) = gen_c(body, tag); + assert!(!h.contains("double x["), "`{body}` is not a float:\n{h}"); + assert!(!h.contains("uint32_t x["), "nor an integer:\n{h}"); + } + let (h, d) = gen_c("var x = [1.];", "trailing"); + assert!(h.contains("double x[1] = { 1. };"), "`1.` is a valid C double:\n{h}"); + if cc_present() { + assert!(!errors(&h, &d).contains("error"), "and it compiles"); + } +} diff --git a/docs/now/2026-09-08-the-answer-was-in-a-comment-forty-lines-away.md b/docs/now/2026-09-08-the-answer-was-in-a-comment-forty-lines-away.md new file mode 100644 index 0000000000..3e818d5eda --- /dev/null +++ b/docs/now/2026-09-08-the-answer-was-in-a-comment-forty-lines-away.md @@ -0,0 +1,9 @@ +# NOW -- The answer was in a comment forty lines away (2026-09-08) + +## The answer was in a comment forty lines away (Refs #3459) + +- 334 of the remaining 837 `__auto_type x = { ... }` errors were one-element lists, and the previous pass filed them because `[7]` arrives as an `ExprArrayLiteral` with ZERO children while the emitted C still reads `{ 7 }`. `children` and `value` had both been searched and both were empty. The field is **`extra_size`**, and the comment naming it -- *«the parser stores the literal's ELEMENT TEXT in extra_size ("1,2,3" for a list, "0;4" for a repeat) with no children»* -- sits on the emitter arm **forty lines from the code that reads it**. RTFM before reverse-engineering, in the most literal sense available. +- Measured: errors **14276 → 14165**, the class **837 → 670**, 18 files better, 2 worse and both unmasking. Across the two passes the class has gone **1729 → 670**. +- **A mutant was BETTER than my guard for one input.** Deleting the dotted-token check types `[1.2.3]` as `double x[1] = { 1.2.3 }` -- a malformed literal in a well-formed declaration -- so the guard is load-bearing. But its first version required digits on BOTH sides of the dot, which refuses `1.`, and `1.` is valid C. The mutant exposed both halves at once: the check was needed AND wrong. It now accepts at most one dot with digits on at least one side. +- `.5` is refused and stays refused: the lexer drops the leading dot and emits `{ 5 }`, so the value is already corrupt before this code sees it. Typing a corrupted initialiser would turn a loud error into a quiet wrong answer. +- The theoretical risk is named rather than hidden: a one-element list whose sole element is a QUOTED all-digit string, `["12"]`, is indistinguishable in `extra_size` from `[12]` because the quotes are already gone -- the old binary emitted `{ 12 }` too. Corpus population of that form: **0**, measured, against 22 single-element string lists whose contents are not digits and which the inference refuses.