Skip to content

Make main green: four tests and the spec inventory after #1205–#1208; D45, D46 - #1212

Merged
ehartford merged 4 commits into
mainfrom
fix-main-red-after-1205-1207
Sep 19, 2026
Merged

ehartford merged 4 commits into
mainfrom
fix-main-red-after-1205-1207

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

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

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 are k.clone(). #1211 tracks measuring whether an O(1) str copy 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/ranlib are what CMake asks of an archiver, not user commands: they are with __ar / with __ranlib, the prefix the inventory treats as the compiler invoking itself. §18.5 lists with cc; §18.8 lists with get --from-source c.X and 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 in docs/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 under WITH_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.

Eric Hartford 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.
@ehartford
ehartford merged commit 8d85cf6 into main Sep 19, 2026
5 checks passed
@ehartford
ehartford deleted the fix-main-red-after-1205-1207 branch September 19, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant