You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: backlog/tasks/task-52 - Specializer-wave-5-—-structural-dialect-sweep-slices-subscripts-operators-star-forms-dup-name-contract-binder-tail.md
-[x]#7 Corpus replay: three-outcome contract holds, zero FAILs, match count reported (ceiling ~130 over 395)
42
+
-[x]#8 Gate green both backends, clippy clean, serving-bench parity gate passes
43
43
<!-- AC:END -->
44
44
45
45
## Implementation Plan
@@ -55,3 +55,21 @@ Stages (each lands with tests + corpus replay green):
55
55
7. Census + bench parity + close-out.
56
56
Spec: docs/superpowers/specs/2026-07-26-wave5-structural-pins.md (pins committed cc28fc0, before implementation).
57
57
<!-- SECTION:PLAN:END -->
58
+
59
+
## Implementation Notes
60
+
61
+
<!-- SECTION:NOTES:BEGIN -->
62
+
Corpus arc through the wave (census_wave5, all zero-FAIL): 395 -> 397 (colon alias) -> 427 (slices+subscripts) -> 431 (bitwise) -> 446 (^@+GLOB) -> 477 (star forms + dup-name rename) -> 484 (binder tail). +89 of the ~130 ceiling; the remainder is gated by dynamic self-joins, wave-B regexp (SIMILAR TO star, COLUMNS), lists/structs, and the USING-unmerge corner.
63
+
64
+
Two replay FAILs caught and fixed during stage 6 (NULL ^@ NULL typing; exec-time IN-list conversion on empty input) — the three-outcome contract did its job; corrections recorded in the spec addendum.
65
+
<!-- SECTION:NOTES:END -->
66
+
67
+
## Final Summary
68
+
69
+
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
70
+
Wave 5 shipped: the structural + dialect sweep, corpus 395 -> 484 bit-exact of 678 (+89, zero wrong answers, zero replay FAILs throughout). Pins-first: an 8-agent measurement fleet (7 DuckDB areas + a sqlparser capability spike) landed as docs/superpowers/specs/2026-07-26-wave5-structural-pins.md + pins-wave5/*.json BEFORE implementation, with a post-landing addendum recording two corpus-caught corrections (NULL ^@ NULL typing; exec-time IN-list conversion — an empty input succeeds in DuckDB, so non-numeric literals stay clean-unsupported).
71
+
72
+
Landed in seven stages: (1a) frontend switched to GenericDialect — measured strict superset, byte-identical corpus; (1b) colon prefix alias k: expr via token pre-rewrite (sqlparser misparses it SILENTLY as a Snowflake JSON path — no error to catch); (2) bracket subscripts s[i] and slices s[a:b] bound onto the wave-3 kernels with chained access, open-bound desugar, and the asymmetric ±2^32 runtime trap window on both backends; (3) bitwise << >> & | + xor() as new i64 BinOps with DuckDB's five-step << trap ladder, >> total, and a source-order re-association pass because DuckDB puts all four in ONE flat left-assoc tier while sqlparser tiers them (fold shares the duck_shl kernel so folding and trapping can never disagree); (4) ^@ -> the starts_with kernel + a dedicated byte-level GLOB matcher (one-byte ?, byte-set classes where only ! negates, literal-if-first ']'/'-' rules, dead patterns match nothing) reached via a LIKE + __glob_pat marker rewrite; (5) star forms — name filters * LIKE/ILIKE/NOT LIKE/GLOB over column names, qualified EXCLUDE, * REPLACE, * RENAME — plus the duplicate-name contract: dedup_output_names applies DuckDB's own boundary rename (left-to-right, own-case _N, case-insensitive incl. candidates), verified against .df(); (6) binder tail — lateral aliases with real-column-wins shadowing in SELECT and WHERE, NULL <op> NULL typing by operator, main.tbl qualifier, NATURAL JOIN desugared to USING with the pinned hard error, t AS u(x,y) via a Cow column view, mixed BETWEEN/IN literal casts with half-away rounding.
73
+
74
+
Gate: 148 Rust + 553 py green (interp backend identical except the deliberate backend-identity guards), clippy clean on wave files, serving-bench parity gate passed on all four scenarios with the typed path at 1.4-2.0x over handcrafted python in 16/16 cells — 27 new surface forms cost the hot path nothing. Remaining unsupported head after the wave: aggregation 45 (out of scope), table-fns 24 (out of scope), regexp ~25+SIMILAR/COLUMNS (wave B), lists/structs 25 (wave C), dynamic self-joins 10, small named tails.
0 commit comments