docs(fork-c/S0): setup contract — byte-baseline + commit-discipline, E6b disposition + two-corpus partition, A–E6 reuse/delete ledger
S0 of the ratified Fork C plan (zero-legacy name-resolution redesign, S0→S6).
Pure setup/documentation: NO production code change, NO behavior change.
Single-author output byte-identical to wt-stdlib-base by construction.
Deliverables under docs/fork-c/ (docs/, not current/, because current/ is
gitignored and the contract must be committed):
S0.1 — byte-baseline + commit-discipline: the committed examples/expected/*
snapshots are the single-author byte-identity reference; the zero-diff repro is
`zig build && zig build test && bash tests/run_examples.sh`. Resolver-target set
explicitly excluded + listed. Commit-classification rule: mirror | consumer-cutover | deletion.
S0.2 — E6b disposition + two-corpus partition: transitional E6b src NOT merged
(grep-clean: no resolveRegistrationSigTypeInSource / sig_registration_mode /
e6br_gate.test.zig on baseline). Harvested 0811–0829 trees + goldens (never the
src), empirically partitioned by running each through the base compiler vs the
E6b target:
- baseline-green (mirror-equivalence): 0795–0798 (merged) + 0823, 0828 — given
examples/expected/ markers, locked into the S0 baseline.
- resolver-target (known-wrong old behavior): 0811–0822, 0824–0827, 0829 + the
re-filed E6BR-5 nested-pattern regression — a listed xfail harness under
tests/resolver-target/ (manifest + TARGET goldens, NO active marker), flips
active+green at S3.9. 0811/0829 noted as old-selector-wrong on the E6b-unmerged
base; E6BR-5 subsumed by the whole-AST resolver, NOT an E6b attempt-6.
S0.3 — A–E6 reuse/delete ledger: every load-bearing A–E6 artifact mapped REUSED
(Fork C home) or DELETED/TRANSITIONAL (S3/S6 phase); E6c/d/e dropped, F/H/I/K
absorbed/superseded.
Gate over the baseline-green corpus: zig build + zig build test (LSP corpus sweep
574 files, no crash) + bash tests/run_examples.sh (540 passed, 0 failed) all exit 0.
This commit is contained in:
49
tests/resolver-target/README.md
Normal file
49
tests/resolver-target/README.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# Resolver-target corpus (Fork C)
|
||||
|
||||
The second of the two Fork C resolver-acceptance corpora. See the full contract in
|
||||
`../../docs/fork-c/S0.2-e6b-disposition-and-two-corpus-partition.md`.
|
||||
|
||||
- **What it is:** harvested E6b semantics goldens (+ the re-filed E6BR-5 regression)
|
||||
that encode the **TARGET** behavior of the Fork C resolver for cases where the
|
||||
**old name-selector is known-wrong on `wt-stdlib-base`** (E6b unmerged) — it
|
||||
silently resolves a global last-wins author / under-diagnoses / picks the wrong
|
||||
author. On this base the old selector is **not a valid oracle**, so these are NOT
|
||||
baseline-green.
|
||||
- **Why separate:** the S2 assert-only mirror proves `resolver == old-selector` over
|
||||
the **baseline-green corpus ONLY**. Asserting that over these cases would force the
|
||||
new resolver to reproduce the old bug. So they live here, inactive, with NO active
|
||||
`examples/expected/` marker — `tests/run_examples.sh` does not run them.
|
||||
- **Never silently dropped:** every case is enumerated in `manifest.md`, its TARGET
|
||||
golden is recorded in `expected/`, and `run_resolver_target.sh` asserts each case
|
||||
currently FAILS to match its target (xfail). If any case unexpectedly MATCHES on
|
||||
the base, the runner flags it `LEAKED` — it is actually baseline-green and must be
|
||||
re-classified (moved to `examples/expected/`), never left here.
|
||||
- **Flip at S3.9:** the Fork C resolver makes these pass; each golden moves to
|
||||
`examples/expected/<name>.{exit,stdout,stderr}` and this harness goes empty.
|
||||
|
||||
## Layout
|
||||
|
||||
```
|
||||
manifest.md enumerated list of all 18 cases (class / base-now / target / note)
|
||||
expected/<name>.exit TARGET exit (08xx: exact E6b bytes; e6br5: spec)
|
||||
expected/<name>.stdout TARGET stdout (08xx only — exact E6b bytes)
|
||||
expected/<name>.stderr TARGET stderr (08xx only — exact E6b bytes)
|
||||
expected/e6br5-*.target.md E6BR-5 spec target (exact bytes finalized at S3.9)
|
||||
cases/e6br5-*.sx + dir/ E6BR-5 authored reproducer (self-contained)
|
||||
run_resolver_target.sh xfail runner (NOT part of the baseline gate)
|
||||
```
|
||||
|
||||
The 08xx **source trees** live under `examples/` (harvested as authored, so their
|
||||
`#import` paths resolve exactly as their baseline-green siblings do) but carry **no**
|
||||
`examples/expected/` marker, so they are inert to `run_examples.sh`. Only their
|
||||
goldens live here. The E6BR-5 reproducer lives entirely under `cases/` (it is
|
||||
self-contained — `modules/std.sx` resolves via the `library/` search path).
|
||||
|
||||
## Run
|
||||
|
||||
```
|
||||
zig build # build the compiler first
|
||||
bash tests/resolver-target/run_resolver_target.sh
|
||||
```
|
||||
|
||||
Expected today (S0): all 18 cases print `xfail`, `0 leaked`, exit 0.
|
||||
@@ -0,0 +1,48 @@
|
||||
// E6BR-5 regression — the open nested-pattern ambiguity hole that PAUSED E6b,
|
||||
// re-filed under Fork C as a RESOLVER-TARGET regression (NOT an E6b attempt-6).
|
||||
//
|
||||
// Shape: a param-impl SOURCE pattern whose concrete `*Box` leaf is NESTED inside
|
||||
// an inner parameterized form that itself carries unbound pack parts
|
||||
// (`Closure(*Box, ..$inner) -> $IR`). On flow/stdlib/E6b the bug lived in
|
||||
// `walkConcreteSigArgs` (lower.zig:14686): it SKIPS any direct arg that has an
|
||||
// unbound part instead of RECURSING into it, so the nested concrete `*Box` leaf
|
||||
// is never ambiguity-checked — `impl ... for Closure(Closure(*Box, ..)->.., ..)->..`
|
||||
// compiled rc=0 while the DIRECT `Closure(*Box, ..)` form (0829) errored. It was
|
||||
// the 3rd consecutive major on the parameterized-pattern surface
|
||||
// (bare E6BR-2 -> wrapped E6BR-4 -> nested E6BR-5).
|
||||
//
|
||||
// CURRENT BASE (wt-stdlib-base, E6b unmerged): both the direct AND the nested
|
||||
// concrete leaf silently resolve via the pre-E6BR-4 no-author wrapper path
|
||||
// (`type_bridge.resolveTemplateSignatureType`, global last-wins) — this program
|
||||
// exits 0 with NO diagnostic. Run it to see the fail-before.
|
||||
//
|
||||
// TARGET (Fork C, flips active+green at S3.9): the whole-AST resolver walks EVERY
|
||||
// reference position — including nested parameterized-pattern leaves — so the
|
||||
// nested `Box` is ambiguity-checked like any other reference and the build emits
|
||||
// the loud "type 'Box' is ambiguous" diagnostic and exits 1. The exact golden
|
||||
// bytes are produced by the resolver at S3.9 (no oracle produces them today);
|
||||
// see ../expected/e6br5-nested-pack-source-ambiguous.target.md for the spec.
|
||||
//
|
||||
// WHY SUBSUMED (one line): a resolver that resolves every reference position has
|
||||
// no notion of "skip a nested arg with an unbound sibling" — the nested `*Box`
|
||||
// leaf is resolved by construction, so the hole cannot exist.
|
||||
|
||||
#import "modules/std.sx";
|
||||
#import "e6br5-nested-pack-source-ambiguous/a.sx";
|
||||
#import "e6br5-nested-pack-source-ambiguous/b.sx";
|
||||
|
||||
Block :: struct { tag: s32; }
|
||||
|
||||
Sink :: protocol(T: Type) {
|
||||
convert :: () -> T;
|
||||
}
|
||||
|
||||
impl Sink(Block) for Closure(Closure(*Box, ..$inner) -> $IR, ..$args) -> $R {
|
||||
convert :: (self: Closure(Closure(*Box, ..$inner) -> $IR, ..$args) -> $R) -> Block {
|
||||
.{ tag = 0 }
|
||||
}
|
||||
}
|
||||
|
||||
main :: () -> s32 {
|
||||
0
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// One of two flat-imported `Box` authors. With no own author, the concrete
|
||||
// `*Box` leaf — even when NESTED inside a parameterized pattern — is a genuine
|
||||
// collision the importing source cannot disambiguate.
|
||||
Box :: struct { a: s32; }
|
||||
@@ -0,0 +1,3 @@
|
||||
// The second flat-imported `Box` author — a DISTINCT nominal from a.sx's `Box`,
|
||||
// so the nested `*Box` leaf is a real ambiguity the source cannot resolve.
|
||||
Box :: struct { b: s32; }
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,29 @@
|
||||
error: type 'IoErr' is ambiguous: it is declared in multiple flat-imported modules; qualify the reference or remove the duplicate import
|
||||
--> examples/0811-modules-same-name-error-set-ambiguous.sx:34:18
|
||||
|
|
||||
34 | fail_io :: () -> !IoErr {
|
||||
| ^^^^^^
|
||||
|
||||
error: type 'IoErr' is ambiguous: it is declared in multiple flat-imported modules; qualify the reference or remove the duplicate import
|
||||
--> examples/0811-modules-same-name-error-set-ambiguous.sx:39:19
|
||||
|
|
||||
39 | sz := size_of(IoErr);
|
||||
| ^^^^^
|
||||
|
||||
error: type 'IoErr' is ambiguous: it is declared in multiple flat-imported modules; qualify the reference or remove the duplicate import
|
||||
--> examples/0811-modules-same-name-error-set-ambiguous.sx:40:9
|
||||
|
|
||||
40 | e : IoErr = error.Disk;
|
||||
| ^^^^^
|
||||
|
||||
error: type 'IoErr' is ambiguous: it is declared in multiple flat-imported modules; qualify the reference or remove the duplicate import
|
||||
--> examples/0811-modules-same-name-error-set-ambiguous.sx:41:16
|
||||
|
|
||||
41 | t : Type = IoErr;
|
||||
| ^^^^^
|
||||
|
||||
error: type 'IoErr' is ambiguous: it is declared in multiple flat-imported modules; qualify the reference or remove the duplicate import
|
||||
--> examples/0811-modules-same-name-error-set-ambiguous.sx:28:14
|
||||
|
|
||||
28 | case IoErr: 1;
|
||||
| ^^^^^
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
own=Disk dep=Net
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1,2 @@
|
||||
own=Disk
|
||||
dep=Net
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,5 @@
|
||||
error: type 'IoErr' is ambiguous: it is declared in multiple flat-imported modules; qualify the reference or remove the duplicate import
|
||||
--> examples/0814-modules-same-name-error-set-lambda-ambiguous.sx:25:30
|
||||
|
|
||||
25 | fail_io := closure(() -> !IoErr { return; });
|
||||
| ^^^^^^
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,29 @@
|
||||
error: type 'Box' is ambiguous: it is declared in multiple flat-imported modules; qualify the reference or remove the duplicate import
|
||||
--> examples/0815-route-all-new-surfaces-ambiguous.sx:25:12
|
||||
|
|
||||
25 | BoxPtr :: *Box;
|
||||
| ^^^
|
||||
|
||||
error: type 'Box' is ambiguous: it is declared in multiple flat-imported modules; qualify the reference or remove the duplicate import
|
||||
--> examples/0815-route-all-new-surfaces-ambiguous.sx:27:21
|
||||
|
|
||||
27 | WrapU :: union { b: Box; n: s32; }
|
||||
| ^^^
|
||||
|
||||
error: type 'Box' is ambiguous: it is declared in multiple flat-imported modules; qualify the reference or remove the duplicate import
|
||||
--> examples/0815-route-all-new-surfaces-ambiguous.sx:29:20
|
||||
|
|
||||
29 | WrapE :: enum { V: Box; }
|
||||
| ^^^
|
||||
|
||||
error: type 'Box' is ambiguous: it is declared in multiple flat-imported modules; qualify the reference or remove the duplicate import
|
||||
--> examples/0815-route-all-new-surfaces-ambiguous.sx:32:20
|
||||
|
|
||||
32 | sz := size_of((Box, s32));
|
||||
| ^^^
|
||||
|
||||
error: type 'Box' is ambiguous: it is declared in multiple flat-imported modules; qualify the reference or remove the duplicate import
|
||||
--> examples/0815-route-all-new-surfaces-ambiguous.sx:33:20
|
||||
|
|
||||
33 | x : union { b: Box; n: s32 } = ---;
|
||||
| ^^^
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
own=5 dep=9
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
x.a=4
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
own.m=5 q.a=9
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
own=Disk q=Net
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
m=7 dep=9
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,5 @@
|
||||
error: type 'Box' is ambiguous: it is declared in multiple flat-imported modules; qualify the reference or remove the duplicate import
|
||||
--> examples/0821-protocols-same-name-method-ambiguous.sx:13:18
|
||||
|
|
||||
13 | get :: () -> Box;
|
||||
| ^^^
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
bp=10 t=12 ev=10 x=13 dep=99
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
p=7 o=7 t=7 a=7 | sp=1 so=1 ss=2 sa=2 st=1 sn=6 dep=9
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,5 @@
|
||||
error: type 'Box' is ambiguous: it is declared in multiple flat-imported modules; qualify the reference or remove the duplicate import
|
||||
--> examples/0825-protocols-same-name-method-wrapped-ambiguous.sx:18:20
|
||||
|
|
||||
18 | getp :: () -> *Box;
|
||||
| ^^^
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
v=7 dep=9
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,5 @@
|
||||
error: type 'Box' is ambiguous: it is declared in multiple flat-imported modules; qualify the reference or remove the duplicate import
|
||||
--> examples/0827-protocols-param-impl-source-wrapped-ambiguous.sx:19:24
|
||||
|
|
||||
19 | impl Into(Marker) for *Box {
|
||||
| ^^^
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,5 @@
|
||||
error: type 'Box' is ambiguous: it is declared in multiple flat-imported modules; qualify the reference or remove the duplicate import
|
||||
--> examples/0829-packs-param-impl-mixed-pack-source-ambiguous.sx:28:31
|
||||
|
|
||||
28 | impl Sink(Block) for Closure(*Box, ..$args) -> $R {
|
||||
| ^^^
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,22 @@
|
||||
# E6BR-5 target spec (exact golden finalized at S3.9)
|
||||
|
||||
Unlike the harvested `08xx` resolver-target cases — whose exact target bytes were
|
||||
produced by the E6b branch and are frozen in `*.exit/*.stdout/*.stderr` here —
|
||||
**E6BR-5 has no oracle that produced exact bytes today** (it is the open hole that
|
||||
paused E6b; no implementation ever emitted its diagnosed form). Its target is
|
||||
therefore recorded as a **specification**, not frozen bytes:
|
||||
|
||||
- **exit:** `1` (see `e6br5-nested-pack-source-ambiguous.exit`).
|
||||
- **stderr:** at least one `error: type 'Box' is ambiguous: it is declared in
|
||||
multiple flat-imported modules; qualify the reference or remove the duplicate
|
||||
import`, pointing at the nested `*Box` leaf inside
|
||||
`Closure(Closure(*Box, ..$inner) -> $IR, ..$args) -> $R`.
|
||||
- **stdout:** empty (the build fails before `main` runs).
|
||||
|
||||
The byte-exact `stdout`/`stderr` goldens are generated by the Fork C resolver when
|
||||
this case **flips to active + green at S3.9** (`run-confirm-r3`: "E6BR-5
|
||||
nested-pattern case diagnosed"). At that point this `.target.md` is replaced by
|
||||
real `e6br5-nested-pack-source-ambiguous.stdout` / `.stderr` files and the case
|
||||
moves to an active marker, exactly like the `08xx` flips.
|
||||
|
||||
This case is the re-filed E6BR-5 regression — **explicitly NOT an E6b attempt-6.**
|
||||
70
tests/resolver-target/manifest.md
Normal file
70
tests/resolver-target/manifest.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Resolver-target corpus — enumerated manifest
|
||||
|
||||
**Status:** INACTIVE / xfail from S0 through S3.8. **Flips to active + green at S3.9.**
|
||||
**Not part of the baseline gate** (`run_examples.sh` does not run these — no active
|
||||
`examples/expected/` marker). The harness runner `run_resolver_target.sh` asserts
|
||||
every case below currently FAILS to match its TARGET, so the set is never silently
|
||||
dropped between S0 and S3.9.
|
||||
|
||||
These cases encode **known-wrong old behavior** on `wt-stdlib-base` (E6b unmerged):
|
||||
the old name-selector silently resolves a global last-wins author (exit 0) where the
|
||||
TARGET is a loud ambiguity (exit 1), OR fails to resolve an own-author where the
|
||||
TARGET is success (exit 0), OR resolves the wrong author (right exit, wrong bytes).
|
||||
On this base the old selector is **not a valid oracle** for them — so they are NOT
|
||||
baseline-green and the S2 mirror must NEVER assert `resolver == old-selector` over
|
||||
this corpus (see `../../docs/fork-c/S0.2-e6b-disposition-and-two-corpus-partition.md`).
|
||||
|
||||
The `08xx` TARGET goldens here are the **exact bytes** the E6b branch
|
||||
(`flow/stdlib/E6b @ af737b0`) produced; copied verbatim, never the transitional src.
|
||||
`e6br5-…` has a spec target only (`*.target.md`) — its exact bytes are produced by
|
||||
the Fork C resolver at S3.9.
|
||||
|
||||
## Failure classes
|
||||
|
||||
- **SILENT-RESOLVE (ambiguous):** base exits 0 (silently picks last-wins) where
|
||||
TARGET is exit 1 (loud ambiguity). The resolver must error.
|
||||
- **UNDER-DIAGNOSE (ambiguous):** base exits 1 but emits FEWER ambiguity
|
||||
diagnostics than the TARGET (catches one site, silently resolves the rest).
|
||||
- **WRONG-AUTHOR (own-wins):** base exits 0 but resolves the wrong author →
|
||||
garbage runtime bytes vs the TARGET stdout.
|
||||
- **OWN-WINS-FAILS (own-wins):** base exits 1 (fails to resolve the own-author)
|
||||
where TARGET is exit 0 (own-author wins and the program runs).
|
||||
|
||||
## Manifest (18 cases)
|
||||
|
||||
| # | case (source tree under `examples/<name>.sx`) | surface | class | base-now | target | note |
|
||||
|---|---|---|---|---|---|---|
|
||||
| 1 | `0811-modules-same-name-error-set-ambiguous` | bare error-set ref (size_of / annotation / type-as-value / match-arm / `!E` channel) | SILENT-RESOLVE | exit 0, silent | exit 1, **5** ambiguity diags | **old selector is wrong here on the E6b-unmerged base** — pre-E6b the `type_bridge.resolveInlineErrorSet` `findByName` short-circuit interned one global last-wins `IoErr` and exited 0 |
|
||||
| 2 | `0812-modules-same-name-error-set-own-wins` | own error-set author wins | OWN-WINS-FAILS | exit 1 | exit 0, `…` | old path fails to resolve the own-author error-set |
|
||||
| 3 | `0813-modules-same-name-error-set-lambda-own-wins` | own error-set in lambda return channel | OWN-WINS-FAILS | exit 1 | exit 0 | lambda `-> !E` own-author not resolved by old path |
|
||||
| 4 | `0814-modules-same-name-error-set-lambda-ambiguous` | ambiguous error-set in lambda return channel | SILENT-RESOLVE | exit 0, silent | exit 1, 1 diag | old path silently resolves the `!E` channel |
|
||||
| 5 | `0815-route-all-new-surfaces-ambiguous` | `*Box` / `union{Box}` / `enum{Box}` / inline-union ambiguous | UNDER-DIAGNOSE | exit 1, **<5** diags | exit 1, **5** diags | old path catches one site, silently resolves the rest |
|
||||
| 6 | `0816-route-all-new-surfaces-own-wins` | own author across the new surfaces | OWN-WINS-FAILS | exit 1 | exit 0 | new surfaces' own-author not resolved by old path |
|
||||
| 7 | `0817-modules-qualified-annotation-single-import-resolve` | qualified annotation, single import | OWN-WINS-FAILS | exit 1 | exit 0 | qualified annotation not resolved by old path |
|
||||
| 8 | `0818-modules-qualified-annotation-own-wins` | qualified annotation, own wins | OWN-WINS-FAILS | exit 1 | exit 0 | — |
|
||||
| 9 | `0819-modules-qualified-annotation-error-set-own-wins` | qualified error-set annotation, own wins | OWN-WINS-FAILS | exit 1 | exit 0 | — |
|
||||
| 10 | `0820-protocols-same-name-method-own-wins` | own protocol-method author wins | OWN-WINS-FAILS | exit 1 | exit 0 | protocol dispatch own-author not resolved by old path |
|
||||
| 11 | `0821-protocols-same-name-method-ambiguous` | ambiguous protocol-method | SILENT-RESOLVE | exit 0, silent | exit 1, 1 diag | old path silently resolves the protocol head |
|
||||
| 12 | `0822-route-all-own-wins-surfaces` | own author across route-all surfaces | OWN-WINS-FAILS | exit 1 | exit 0 | — |
|
||||
| 13 | `0824-protocols-same-name-method-wrapped-own-wins` | wrapped protocol-method, own wins | OWN-WINS-FAILS | exit 1 | exit 0 | — |
|
||||
| 14 | `0825-protocols-same-name-method-wrapped-ambiguous` | wrapped protocol-method, ambiguous | SILENT-RESOLVE | exit 0, silent | exit 1, 1 diag | — |
|
||||
| 15 | `0826-protocols-param-impl-source-wrapped-own-wins` | wrapped param-impl source, own wins | WRONG-AUTHOR | exit 0, `v=<garbage>` | exit 0, `v=7 dep=9` | base resolves the wrong author → garbage field value |
|
||||
| 16 | `0827-protocols-param-impl-source-wrapped-ambiguous` | wrapped param-impl source, ambiguous | SILENT-RESOLVE | exit 0, silent | exit 1, 1 diag | — |
|
||||
| 17 | `0829-packs-param-impl-mixed-pack-source-ambiguous` | mixed pack-closure param-impl, concrete `*Box` prefix ambiguous | SILENT-RESOLVE | exit 0, silent | exit 1, 1 diag | **old selector is wrong here on the E6b-unmerged base** — pre-E6BR-4 the `*Box` collision fell to the no-author `resolveTemplateSignatureType` wrapper (global last-wins) and registered silently |
|
||||
| 18 | `e6br5-nested-pack-source-ambiguous` (tree under `tests/resolver-target/cases/`) | NESTED concrete `*Box` leaf inside `Closure(Closure(*Box,..)->.., ..)->..` | SILENT-RESOLVE | exit 0, silent | exit 1, ≥1 diag (spec, S3.9) | **re-filed E6BR-5** — the open nested-pattern hole that paused E6b (`walkConcreteSigArgs` lower.zig:14686 skipped nested args); subsumed by the whole-AST resolver, **NOT an E6b attempt-6** |
|
||||
|
||||
## Provenance
|
||||
|
||||
- Cases 1–17: source trees harvested from `flow/stdlib/E6b @ af737b0` into
|
||||
`examples/<name>.sx` (+ sibling module dir), goldens copied verbatim from
|
||||
`flow/stdlib/E6b:examples/expected/<name>.*` into `expected/<name>.*` here. The
|
||||
transitional E6b src was NOT harvested.
|
||||
- Case 18 (E6BR-5): authored reproducer (no E6b tree ever existed); lives entirely
|
||||
under `cases/` with a spec target in `expected/…target.md`.
|
||||
|
||||
## Flip at S3.9
|
||||
|
||||
Each row maps to an active `examples/expected/<name>.{exit,stdout,stderr}` marker
|
||||
when it flips (the `08xx` trees are already in `examples/`; only the goldens move
|
||||
from `expected/` here to `examples/expected/`). After S3.9 this harness is empty and
|
||||
every entry above is an active, green baseline test validated against its TARGET.
|
||||
89
tests/resolver-target/run_resolver_target.sh
Executable file
89
tests/resolver-target/run_resolver_target.sh
Executable file
@@ -0,0 +1,89 @@
|
||||
#!/bin/bash
|
||||
# Resolver-target xfail harness (Fork C S0.2).
|
||||
#
|
||||
# NOT part of the baseline gate. The baseline gate is `zig build && zig build test
|
||||
# && bash tests/run_examples.sh` over the BASELINE-GREEN corpus only; this harness
|
||||
# is a separate, listed diagnostic so the resolver-target corpus is never silently
|
||||
# dropped between S0 and S3.9.
|
||||
#
|
||||
# Contract (S0 -> S3.8): every case below currently FAILS to match its TARGET
|
||||
# golden on wt-stdlib-base (the old selector is known-wrong for it). This script
|
||||
# runs each case and asserts the MISMATCH. It exits 0 when ALL cases still xfail
|
||||
# (as expected today), and exits 1 if any case unexpectedly MATCHES its target —
|
||||
# which means that case is actually baseline-green and must be re-classified
|
||||
# (moved to examples/expected/ with an active marker), not silently left here.
|
||||
#
|
||||
# At S3.9 the Fork C resolver makes these pass; the flip is then performed by
|
||||
# moving each golden to examples/expected/ and this harness goes empty.
|
||||
#
|
||||
# Usage: bash tests/resolver-target/run_resolver_target.sh
|
||||
|
||||
set -uo pipefail
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
ROOT_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
SX="$ROOT_DIR/zig-out/bin/sx"
|
||||
EXP_DIR="$SCRIPT_DIR/expected"
|
||||
TIMEOUT=10
|
||||
|
||||
normalize() {
|
||||
sed -E \
|
||||
-e 's/0x[0-9a-f]{4,}/0xADDR/g' \
|
||||
-e 's#(/[^[:space:]]*)?/(examples|issues)/#\2/#g'
|
||||
}
|
||||
|
||||
if [[ ! -x "$SX" ]]; then
|
||||
echo "error: $SX not built — run 'zig build' first" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
TMP_ERR="$(mktemp)"
|
||||
trap 'rm -f "$TMP_ERR"' EXIT
|
||||
|
||||
XFAIL=0 # currently-failing as expected
|
||||
LEAKED=0 # unexpectedly matches target -> must be reclassified baseline-green
|
||||
MISSING=0
|
||||
|
||||
for exit_file in "$EXP_DIR"/*.exit; do
|
||||
[[ -e "$exit_file" ]] || continue
|
||||
name=$(basename "$exit_file" .exit)
|
||||
|
||||
# Source tree: harvested 08xx live under examples/; e6br5 under cases/.
|
||||
if [[ -f "$ROOT_DIR/examples/${name}.sx" ]]; then
|
||||
sx_file="$ROOT_DIR/examples/${name}.sx"
|
||||
elif [[ -f "$SCRIPT_DIR/cases/${name}.sx" ]]; then
|
||||
sx_file="$SCRIPT_DIR/cases/${name}.sx"
|
||||
else
|
||||
printf ' %-55s MISSING-SOURCE\n' "$name"
|
||||
MISSING=$((MISSING + 1))
|
||||
continue
|
||||
fi
|
||||
|
||||
actual_out=$(timeout "$TIMEOUT" "$SX" run "$sx_file" 2>"$TMP_ERR" | normalize)
|
||||
actual_exit=${PIPESTATUS[0]}
|
||||
actual_err=$(normalize < "$TMP_ERR")
|
||||
|
||||
target_exit=$(cat "$exit_file")
|
||||
# spec-only targets (e6br5) have no .stdout/.stderr — compare exit only.
|
||||
if [[ -f "$EXP_DIR/${name}.stdout" ]]; then
|
||||
target_out=$(normalize < "$EXP_DIR/${name}.stdout")
|
||||
target_err=$(normalize < "$EXP_DIR/${name}.stderr")
|
||||
if [[ "$actual_exit" == "$target_exit" && "$actual_out" == "$target_out" && "$actual_err" == "$target_err" ]]; then
|
||||
matches=1
|
||||
else
|
||||
matches=0
|
||||
fi
|
||||
else
|
||||
[[ "$actual_exit" == "$target_exit" ]] && matches=1 || matches=0
|
||||
fi
|
||||
|
||||
if [[ $matches -eq 1 ]]; then
|
||||
printf ' %-55s LEAKED (matches target on base -> reclassify baseline-green)\n' "$name"
|
||||
LEAKED=$((LEAKED + 1))
|
||||
else
|
||||
printf ' %-55s xfail (base exit=%s, target exit=%s)\n' "$name" "$actual_exit" "$target_exit"
|
||||
XFAIL=$((XFAIL + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
echo "$XFAIL xfail (expected), $LEAKED leaked, $MISSING missing-source"
|
||||
[[ $LEAKED -eq 0 && $MISSING -eq 0 ]]
|
||||
Reference in New Issue
Block a user