Simplify and harden lexer internals#674
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
# Conflicts: # source/units/Goccia.Lexer.pas
Benchmark Results407 benchmarks Interpreted: 🟢 32 improved · 🔴 129 regressed · 246 unchanged · avg -1.3% arraybuffer.js — Interp: 🔴 11, 3 unch. · avg -4.3% · Bytecode: 🔴 14 · avg -21.2%
arrays.js — Interp: 🟢 8, 🔴 1, 10 unch. · avg +1.2% · Bytecode: 🔴 19 · avg -25.2%
async-await.js — Interp: 🔴 2, 4 unch. · avg -2.5% · Bytecode: 🔴 6 · avg -22.2%
async-generators.js — Interp: 🔴 1, 1 unch. · avg -1.9% · Bytecode: 🔴 2 · avg -23.5%
base64.js — Interp: 🟢 1, 9 unch. · avg -0.2% · Bytecode: 🔴 9, 1 unch. · avg -22.2%
classes.js — Interp: 🔴 10, 21 unch. · avg -1.8% · Bytecode: 🔴 31 · avg -20.0%
closures.js — Interp: 🔴 9, 2 unch. · avg -4.1% · Bytecode: 🔴 11 · avg -22.6%
collections.js — Interp: 🔴 3, 9 unch. · avg -1.2% · Bytecode: 🔴 12 · avg -22.8%
csv.js — Interp: 🔴 3, 10 unch. · avg -0.9% · Bytecode: 🔴 13 · avg -20.8%
destructuring.js — Interp: 🔴 7, 15 unch. · avg -2.4% · Bytecode: 🔴 22 · avg -22.7%
fibonacci.js — Interp: 🔴 3, 5 unch. · avg -2.6% · Bytecode: 🔴 8 · avg -23.9%
float16array.js — Interp: 🟢 2, 🔴 8, 22 unch. · avg -1.0% · Bytecode: 🔴 32 · avg -22.6%
for-of.js — Interp: 🔴 2, 5 unch. · avg -1.7% · Bytecode: 🔴 7 · avg -23.8%
generators.js — Interp: 4 unch. · avg +0.4% · Bytecode: 🔴 4 · avg -20.5%
iterators.js — Interp: 🟢 2, 🔴 29, 11 unch. · avg -3.3% · Bytecode: 🔴 42 · avg -22.9%
json.js — Interp: 🟢 1, 🔴 4, 15 unch. · avg -1.7% · Bytecode: 🔴 20 · avg -20.5%
jsx.jsx — Interp: 🟢 1, 🔴 2, 18 unch. · avg -0.4% · Bytecode: 🔴 21 · avg -21.7%
modules.js — Interp: 🔴 2, 7 unch. · avg -4.7% · Bytecode: 🔴 9 · avg -24.0%
numbers.js — Interp: 🔴 1, 10 unch. · avg -1.6% · Bytecode: 🔴 11 · avg -21.0%
objects.js — Interp: 🟢 3, 4 unch. · avg +2.1% · Bytecode: 🔴 7 · avg -22.5%
promises.js — Interp: 🟢 1, 🔴 5, 6 unch. · avg -2.5% · Bytecode: 🔴 12 · avg -18.2%
regexp.js — Interp: 🔴 4, 7 unch. · avg -2.9% · Bytecode: 🔴 11 · avg -23.1%
strings.js — Interp: 🟢 2, 🔴 1, 16 unch. · avg +0.1% · Bytecode: 🔴 19 · avg -22.0%
tsv.js — Interp: 🔴 3, 6 unch. · avg -1.0% · Bytecode: 🔴 9 · avg -22.8%
typed-arrays.js — Interp: 🟢 9, 🔴 4, 9 unch. · avg +13.7% · Bytecode: 🟢 1, 🔴 21 · avg -25.9%
uint8array-encoding.js — Interp: 🟢 1, 🔴 10, 7 unch. · avg -9.5% · Bytecode: 🔴 18 · avg -19.6%
weak-collections.js — Interp: 🟢 1, 🔴 4, 10 unch. · avg -3.0% · Bytecode: 🟢 4, 🔴 9, 2 unch. · avg -5.0%
Deterministic profile diffDeterministic profile diff: no significant changes. Measured on ubuntu-latest x64. Benchmark ranges compare cached main-branch min/max ops/sec with the PR run; overlapping ranges are treated as unchanged noise. Percentage deltas are secondary context. |
Suite TimingTest Runner (interpreted: 9,736 passed; bytecode: 9,736 passed)
MemoryGC rows aggregate the main thread plus all worker thread-local GCs. Test runner worker shutdown frees thread-local heaps in bulk; that shutdown reclamation is not counted as GC collections or collected objects.
Benchmarks (interpreted: 407; bytecode: 407)
MemoryGC rows aggregate the main thread plus all worker thread-local GCs. Benchmark runner performs explicit between-file collections, so collection and collected-object counts can be much higher than the test runner.
Measured on ubuntu-latest x64. |
- Build lexer keyword map from centralized reserved/contextual lists - Replace parser reserved-word checks with shared helper - Tokenize contextual keywords directly in the lexer
test262 Conformance
Areas closest to 100%
Per-test deltas (+1 / -0)Newly passing (1):
Steady-state failures are non-blocking; regressions vs the cached main baseline (lower total pass count, or any PASS → non-PASS transition) fail the conformance gate. Measured on ubuntu-latest x64, bytecode mode. Areas grouped by the first two test262 path components; minimum 25 attempted tests, areas already at 100% excluded. Δ vs main compares against the most recent cached |
Summary
origin/maininto the PR branch and preserve main's Unicode identifier validation changes.Testing
Commands run:
./build.pas clean tests testrunner./build/Goccia.Lexer.Test./build/GocciaTestRunner tests --asi --unsafe-ffi --no-progress./format.pas --checkgit diff --checkBenchmark note:
85dac6c5) against latestorigin/main(51ff745f) using the same 457 KB generated lexer-heavy JS source, 1 warmup + 20 measuredGocciaScriptLoader --output=jsonruns per build.origin/mainto 35.08 ms on this branch (~9.5% faster); lex average improved from 47.05 ms to 35.80 ms (~23.9% faster, with noisy main outliers).