Repository navigation
Make main green: four tests and the spec inventory after #1205–#1208; D45, D46 - #1212
Merged
Merged
Conversation
added 4 commits
September 19, 2026 03:32
Both merged before their batteries ran. A battery on main (f5cba02) fails behav_tls_module_compiles.w and behav_error_handling.w. #1205: the "return type of 'X' was not known here" report fired on `i31_reduce_once(x, m, mlen)` in std/crypto/bigint.w. That call is a statement: its value is discarded, so the placeholder type cost it nothing. A block now marks the statement it is checking, and a call in that position is not recorded. A call that is a block's tail still is — under D43 the tail is the function's type. #1207: `for s in inputs` over an array of str now binds `&str` (traversal observes), and the test passed `s` to `parse_positive(s: str)`, which only reads it. The function takes `&str`, as an observer should (§3.8).
The battery on the first fix found two more tests red on main. err_thread_spawn_closure_captures_ref.w (#1205): checking every unannotated function first put `bad` ahead of std.thread.spawn_os, whose body gives its closure parameter the escape effect `bad`'s call is judged by, so a weaker diagnostic fired. Bodies are checked in declaration order again; a function that takes its type from its body is checked before the first declaration that calls it, and nothing else moves. The calls come from the AST: nodes are appended children first, so a declaration's subtree is the ids between it and the nearest declaration node below it. A chain of unannotated functions now types (it was reported before); a cycle gets D43's "cannot infer return type ... add `-> T`". spec_ss13_6_comprehensions.w (#1207): lower_comprehension_slice was a copy of lower_for_slice's setup with the same defects — it moved the iterable, took RK_LEN through projections and copied Drop-class elements — while Sema now binds views. The receiver, length and element binding are shared helpers, used by both. A map comprehension stores what it builds: a `&T` key or value with T: Copy materializes a T (D22); a view of a Drop-class value is an error that says to clone it, where it said "`&str` must implement Hash". The test's str keys are cloned; on the pinned seed the same comprehension over a Vec[(str, i32)] already failed, and the array form only passed by making the map a second owner of the array's strings.
spec-inventory-check on main: "implementation has unspec'd ar / cc / ranlib / --from-source" (from #1208, which merged without a battery). `ar` and `ranlib` are what a CMake build asks of an archiver, not commands a user types: they are `with __ar` and `with __ranlib`, the prefix the inventory already treats as the compiler invoking itself. `with cc` and `with get --from-source` are user surface and wait for spec words. D45 (Eric, 2026-09-19): a copy is never implicit unless it is O(1). The comprehension fix in this branch follows it; #1211 tracks the measurement that could reopen it.
…essed) Eric blessed this wording on 2026-09-19. §18.5 lists `with cc`. §18.8 lists `with get --from-source c.X` and says how `with get` builds a package from source when Conan Center has no linkable binary: the recipe read as data, the package's own CMake build under `with cc`, installed and locked like a binary package, and a missing tool named rather than worked around. §13.6's examples that build owning collections of `str` from views clone their elements, and the section says why (D22, D45). The inventory checker lists `--from-source` beside `--force-reinstall`: a `with get` flag, documented in §18.8. D46 records the source-build decisions and what was rejected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main is red: #1205, #1206, #1207 and #1208 merged before their batteries ran. A battery on main failed four tests and
spec-inventory-check. This PR makes main green. Its battery ran first, on main + this branch, and is green (below).The four tests
behav_tls_module_compiles(Type a function from its body before the callers that have a written type (#1196) #1205) — the "return type of 'X' was not known here" report fired oni31_reduce_once(x, m, mlen)instd/crypto/bigint.w, a call in statement position whose value is discarded. A block marks the statement it is checking; a call there is not recorded. A call that is a block's tail still is (under D43 the tail is the function's type).err_thread_spawn_closure_captures_ref(Type a function from its body before the callers that have a written type (#1196) #1205) — checking every unannotated function first putbadahead ofstd.thread.spawn_os, whose body gives its closure parameter the escape effect the call is judged by; a weaker diagnostic fired. Bodies are checked in declaration order again; a function that takes its type from its body is checked before the first declaration that calls it, and nothing else moves. The calls come from the AST (nodes are appended children first, so a declaration's subtree is a contiguous id range). This also closes what Type a function from its body before the callers that have a written type (#1196) #1205 left open: a chain of unannotated functions now types; a cycle gets D43's "cannot infer return type … add-> T".behav_error_handling(forover a slice or array observes: no second owner, no consumed array (#1197) #1207) —for s in inputsover[N]strbinds&str; the test passed it toparse_positive(s: str), which only reads. It takes&str(§3.8).spec_ss13_6_comprehensions(forover a slice or array observes: no second owner, no consumed array (#1197) #1207) —lower_comprehension_slicewas a copy oflower_for_slice's setup with the same defects (moved the iterable,RK_LENthrough projections, copied Drop-class elements) while Sema now binds views. Receiver, length and element binding are shared helpers used by both. A map comprehension stores what it builds: a&Tkey or value withT: Copymaterializes aT(it stored&i32); a view of a Drop-class value is an error that says to clone it (it said "&strmust implement Hash").D45 (Eric, 2026-09-19): a copy is never implicit unless it is O(1)
let words: HashSet[str] = [w for w in tokens]does not clone implicitly. Reference survey, verified in.reference/: none of go/mojo/rust/scala3/swift/Vale/zig copies a string implicitly while paying an allocation; the implicit ones made the copy O(1) first; Rust, whose clone allocates, spells it. The test's keys arek.clone(). #1211 tracks measuring whether an O(1)strcopy pays; if it does, D22 extends by one line and these clones go.Spec (wording blessed by Eric, 2026-09-19) and
spec-inventory-check#1208 added CLI surface with no spec text.
ar/ranlibare what CMake asks of an archiver, not user commands: they arewith __ar/with __ranlib, the prefix the inventory treats as the compiler invoking itself. §18.5 listswith cc; §18.8 listswith get --from-source c.Xand describes the source build; §13.6's examples clone, and say why. D45 and D46 (source builds: recipe as data, no per-package files, prerequisites named, OpenSSL not a UAT) are indocs/decisions.md.Battery — seed-driven, on main (43db527) + this branch
build ✓ · fixpoint ✓ (107.8 s) ·
:test-with-audits✓ (842.3 s) ·:move-audit✓ · test-green ✓ · last-green ✓ ·:release-uat✓ (darwin; its first run failed only raylib's "no OpenGL 3.3 context" because the laptop's display was asleep — green with the display awake). Every affected test also passes underWITH_DEBUG_ALLOC_SCRIBBLE=1, and the compiler's own source checks clean under the new compiler.This is also the first battery #1208's code has had.