#617 M2: expose takeFlatMap/takeMap on std/list, and give the .ail suites a CI gate they never had - #668
Merged
Conversation
…uites a CI gate they never had M2 of M-TAKE-FLATMAP-PEAK-MEMORY. Closes AC-1, AC-2 (.ail half), AC-3a, AC-4. - std/list.ail: `takeFlatMap` / `takeMap` exports delegating to the fused builtins, placed before the effectful section. Doc comments carry the corrected cost model (peak = source residency + largest single f(x) + n retained) and say plainly that neither bounds peak by n — what they bound is how many inputs f is invoked on. - examples/runnable/bounded_take_flatmap.ail + manifest entry, expected.stdout taken from the file's own run. - tests/stdlib/: parity suite (n=0, n>total, empty inner lists, dedup composition) and the delegation instrument — takeFlatMap(4, boom, [1,2,3,4,5]) exits 0 and prints [1, 1, 2, 2] only because f never runs on the input that divides by zero. The delegation instrument is the point: an export body written as `take(n, flatMap(f, xs))` is output-identical and passes every equality test, so nothing but a divergence probe pins the export to the fused mechanism. CONTROLLER FINDING — the pins had no gate. `grep -rn "ailang test" make/ Makefile` returned ZERO (control: `.ail` in make/ = 35; 28 targets in test.mk), so no make target and no CI job ran any .ail suite. AC-3a and AC-4 would have shipped as one-shot acceptance commands against a tree that no longer exists. Added `make test-stdlib-ail`, wired into ci.yml, with an anti-vacuity floor on both loops — an empty glob fails loudly, since "no suites found" and "all suites green" are otherwise the same exit code. The .expected fixtures are captured from the product's own stdout and diffed against a verbatim re-run rather than reconstructed. Non-vacuity, controller-run outside the sandbox: the unfused-body mutant LANDS (sha256) and still TYPE-CHECKS (so the red is not a compile failure) and reds `make test-stdlib-ail` rc=2; the empty-glob arm hits the floor rc=2. Off-by-one mutants at both early-exit sites (`len(result) >= n` in takeFlatMapImpl, `len(result) < n` in takeMapImpl — two different forms, so one sed cannot reach both) each LAND, BUILD (go build rc=0) and red the parity suite. All mutants restored byte-identical from cp backups. Gates (controller, outside sandbox): go test ./internal/builtins ./internal/pipeline rc=0; verify-examples rc=0 (188 modules, missing-on-disk held at the pre-existing 1); lint, fmt-check, check-file-sizes, check-changelog all rc=0. Co-Authored-By: codex gpt-5.6-sol Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
sunholo-voight-kampff
added a commit
that referenced
this pull request
Aug 12, 2026
…ral pin had no CI gate (#673) Gate 4 record: charter STATUS 183 (+ rotation, iteration 180 archived), log entry 186, dashboard rewritten at exactly 40 lines. Rotation arithmetic asserted before writing: before=1918, after=1918, expected=1918 (before + 2 - 2*1). Rotation invariant 3. Post-edit queue-row check passed (queue header present, 68 LANDED rows) — the STATUS block cannot show that damage. The iteration's finding: `grep -rn "ailang test" make/ Makefile` returns ZERO (control `.ail` in make/ = 35). No make target and no CI job ran ANY .ail suite, so #617 M2's AC-3a and AC-4 were one-shot acceptance commands against a tree that no longer exists. Fixed in #668 by `make test-stdlib-ail` + a ci.yml step with anti-vacuity floors. Two bugs filed from the drills rather than from the sprint: - #669 `ailang test` reports FALSE FAILURES for a stdlib export delegating to another same-module AILANG export; three hypotheses refuted by measurement. - #670 `expected.stdout` is display-only for all 194 examples; corrupting one leaves `make verify-examples` at rc=0. Gate 3b GREEN on 6a67bb7 (SHA-addressed checks=16, zero NOT-GREEN). Evaluator sonnet PASS 95/100 r1, zero blocking. metered=$0.00. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.



M2 of M-TAKE-FLATMAP-PEAK-MEMORY (#617). Closes AC-1, AC-2 (
.ailhalf), AC-3a, AC-4.Design doc + sprint plan:
design_docs/planned/m-take-flatmap-peak-memory*.md. M1 landed in #661.What ships
std/list.ail—takeFlatMap/takeMapexports delegating to the fused builtins, placed before the effectful section. Doc comments carry the corrected cost model (peak = source residency + largest single f(x) + n retained) and state plainly that neither bounds peak byn; what they bound is how many inputsfis invoked on.examples/runnable/bounded_take_flatmap.ail+ manifest entry,expected.stdouttaken from the file's own run.tests/stdlib/— parity suite (n=0, n>total, empty inner lists,dedup∘takeFlatMap) and the delegation instrument:takeFlatMap(4, boom, [1,2,3,4,5])exits 0 and prints[1, 1, 2, 2]only becausefnever runs on the input that divides by zero.The delegation instrument is the point. An export body written as
take(n, flatMap(f, xs))is output-identical and passes every equality test, so nothing but a divergence probe pins the export to the fused mechanism.Controller finding: the pins had no gate
grep -rn "ailang test" make/ Makefilereturned zero (control:.ailinmake/= 35, 28 targets intest.mk). No make target and no CI job ran any.ailsuite, so AC-3a and AC-4 would have shipped as one-shot acceptance commands against a tree that no longer exists.Added
make test-stdlib-ail, wired intoci.yml, with an anti-vacuity floor on both loops — an empty glob fails loudly, since "no suites found" and "all suites green" are otherwise the same exit code. The.expectedfixtures are captured from the product's own stdout and diffed against a verbatim re-run rather than reconstructed by the gate.Verification (controller-run, outside the executor sandbox)
take(n, flatMap(f, xs)))ailang checkrc=0make test-stdlib-ailrc=2; delegation fixture diespanic: division by zerolen(result) >= n→> n(takeFlatMapImpl)go buildrc=0len(result) < n→<= n(takeMapImpl)go buildrc=0TestTakeMapBasic/TestTakeMapEarlyExitinstrument failureThe two early-exit sites use different forms, so a single sed cannot reach both — each was mutated separately. All mutants restored byte-identical from
cpbackups.Gates:
go test ./internal/builtins ./internal/pipelinerc=0 ·verify-examplesrc=0 (188 modules,missing-on-diskheld at the pre-existing 1) ·lint,fmt-check,check-file-sizes,check-changelogrc=0.Out of scope (M3/M4): limitations docs, prompt v0.16.6, footgun row, changelog, the
LIST_TAKE_AFTER_FLATMAPdiagnostic.🤖 Generated with Claude Code