Repository navigation
refactor(parser): move token classification into internal/tokclass [W3-03a1] - #947
ajitpratap0 wants to merge 6 commits into
Conversation
…th differential harness [W3-03a1] Pure move of compound tables, IDENT/KEYWORD remap, COUNT..MAX -> IDENT and backtick width rules; preprocess.go keeps only the loop. Adds a parser-mode differential harness against a frozen copy of the old pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @ajitpratap0's task in 16s —— View job Review of PR #947 (token classification move into
|
Perf gate: PASS (shadow mode: report only, this check never fails)Base Runner CPU:
Rules: each arm runs 20 randomized code layouts ( Gated suite (GOGC=off, GOMAXPROCS=1)
A/A' control (base revision, disjoint layout seeds): 0 of 52 benchmarks moved more than 3%; 0 would have been flagged by the time rule; suite geomean +0.11%, p 0.678. Low power4 benchmark(s) have under 80% estimated power to be flagged on their own for a +5% slowdown (their spread across layouts is too wide for 20 layouts at the Benjamini-Hochberg level alpha/m = 0.000192). A slowdown below the last column usually goes unflagged there; instructions/op, allocs/op and the suite geomean still guard them.
Power is estimated with the normal approximation for the U test (Noether): power = Phi(ln(1+shift)/s * sqrt(K/2) * sqrt(3/pi) - z(1 - alpha/(2m))), with s the spread and K the layouts per arm. Instructions per operation (cmd/perfdriver)
Secondary metric: default GC, GOMAXPROCS=1 (informational)
Environmentbenchstat (primary metric, samples pooled across layouts: informational, the verdict uses the per-layout test) |
|
Claude finished @ajitpratap0's task in 24s —— View job Review of PR #947 (token classification move into
|
|
Claude finished @ajitpratap0's task in 31s —— View job Review of PR #947 (token classification move into
|
|
Claude finished @ajitpratap0's task in 24s —— View job Review of PR #947 (token classification move into
|
|
Perf gate re-run on exact head 4b58a19 (workflow_dispatch run 42320036752, layout-randomized, 20 layouts per arm): PASS. Suite geomean -0.02% (p 0.841), A/A' control quiet (0 of 52 moved >3%), allocs/op +0.00%, B/op +0.00%. 2 benchmarks in the Low power list; allocs/op, B/op and instructions/op carry the verdict there. Opus diff review: pure move, no findings. 🤖 Generated with Claude Code |
Summary
Pure move of the parser-facing token classification (compound split tables, IDENT/KEYWORD remap, COUNT..MAX -> IDENT, backtick width, type gate) from
pkg/sql/parser/preprocess.gointointernal/tokclass.preprocess.gokeeps only the loop. Adds a parser-mode differential harness against a frozen copy of the old pass, ready for W3-03b to plug in the tokenizer parser-ready mode. Perf-neutral; no public API change.Test Plan
task checkpass,task test:cbindingpass,go test -count=1 ./pkg/compatibility/...pass, staticcheck clean on tokclass/parser/tokenizer.task check.LintRW/mariadb16563 -> 16562 (improvement); B/op +-0.00%. Low power section:LintRule/L010(spread 17.74%),LintRW/snowflake(4.60%),ParseError/long_prefix/validate(3.51%) andLintRW/clickhouse(3.33%); none is a target of this PR, and allocs/op, B/op and the suite geomean still guard them.ParseStage/preprocessandPreprocessTokensare not in the gated suite, so the gate judges this change only throughParseE2E,ParseRWandParseFresh.task bench:ab BASE=a72ec74d(indicative only, shared M4; 20 layouts): preprocess geomean +0.02%, allocs/op and B/op identical.Gate table
ParseE2E/simple_selectParseE2E/select_whereParseE2E/joinParseE2E/aggregateParseE2E/subqueryParseE2E/cteParseE2E/windowParseE2E/complexParseE2E/insertParseE2E/updateParseE2E/deleteParseRW/postgresql/mediumParseRW/mysql/mediumParseRW/mariadb/mediumParseRW/sqlserver/mediumParseRW/oracle/mediumParseRW/sqlite/mediumParseRW/snowflake/mediumParseRW/clickhouse/mediumParseFresh/simple_selectParseFresh/joinParseFresh/complexPoolGetPut/serialTokenize/scratch/joinTokenize/scratch/complexTokenize/scratch/insertNormalize/simple_selectNormalize/joinNormalize/complexTransformParse/simple_selectTransformParse/joinTransformParse/complexLintParallel/rulesLintParallel/lintLintRW/postgresqlLintRW/mysqlLintRW/mariadbLintRW/sqlserverLintRW/oracleLintRW/sqliteLintRW/snowflakeLintRW/clickhouseLintRule/L007LintRule/L010ParseError/syntax_mid/parseParseError/syntax_mid/validateParseError/syntax_end/parseParseError/syntax_end/validateParseError/tokenize/parseParseError/tokenize/validateParseError/long_prefix/parseParseError/long_prefix/validateLocal benchstat sec/op (indicative)
Breaking Changes
None.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2