test(specializer): pin substr negative-start paths; xfail the constant-fold known residual - #28
Merged
Merged
Conversation
…ty green, constant-fold divergence xfail-strict The TASK-45-review substr report compared the engine's column path against DuckDB's constant-fold path. Measured (DuckDB 1.5.5): those two DuckDB paths disagree with each other on negative starts; the engine matches the vectorized path, per the builtin-pins spec §4 pin. Column-path triples from the report now pass differentially; the pure-literal known residual is documented as a strict xfail. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ahrzb
approved these changes
Jul 26, 2026
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.
Finding: the TASK-45-review substr "parity bug" is not an engine bug
The report compared two different DuckDB paths. Measured on DuckDB 1.5.5:
substr('ab', -4, 2)'''ab''ab'substr('ab', -3, 2)'a''ab''ab'substr('ab', -5, 3)'''ab''ab'DuckDB disagrees with itself: the constant-fold path clamps the window after applying length, the vectorized path clamps
rsto 1 first. The engine deliberately pins the vectorized path — the one every column input (and the mined corpus) takes — perdocs/superpowers/specs/2026-07-26-stretch4-builtin-pins.md§4, which already records the pure-literal case as a known residual. The report's proposed fix (drop the pre-clamp) would break column-path parity for these same triples.What this PR adds
test_substr_negative_start_column_path_differential— the report's triples through the column path; passes, proving engine ↔ DuckDB agreement where it matters.test_substr_constant_fold_divergence— the pure-literal shape,xfail(strict=True); makes the spec's known residual executable. Flips loudly if the engine ever grows a constant-fold mirror or a DuckDB bump reconciles the paths.No engine change (per the native-engine bug process: no inline fix without a ticket). Suite: 35 passed, 1 xfailed.
🤖 Generated with Claude Code