Centralize CLI source pipeline handling#685
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a CLI-specific source-pipeline wrapper (TGocciaCLISourcePipelineResult) that owns parse artifacts and warning printing, introduces a shared WriteSourceMapIfAvailable helper, and refactors CLI apps (Bundler, ScriptLoader, REPL, TestRunner, BenchmarkRunner) to use them. ChangesCLI Source Pipeline Result and Application Updates
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Suite TimingTest Runner (interpreted: 9,798 passed; bytecode: 9,798 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. |
Benchmark Results407 benchmarks Interpreted: 🟢 44 improved · 🔴 53 regressed · 310 unchanged · avg +1.3% arraybuffer.js — Interp: 🟢 7, 7 unch. · avg +7.2% · Bytecode: 🟢 1, 🔴 10, 3 unch. · avg -6.6%
arrays.js — Interp: 🟢 6, 🔴 1, 12 unch. · avg +4.7% · Bytecode: 🔴 19 · avg -14.7%
async-await.js — Interp: 🟢 1, 🔴 1, 4 unch. · avg +12.8% · Bytecode: 🔴 5, 1 unch. · avg -7.5%
async-generators.js — Interp: 🟢 2 · avg +37.9% · Bytecode: 🔴 1, 1 unch. · avg -11.7%
base64.js — Interp: 🔴 2, 8 unch. · avg -1.0% · Bytecode: 🟢 4, 🔴 2, 4 unch. · avg -1.2%
classes.js — Interp: 🔴 5, 26 unch. · avg -0.9% · Bytecode: 🔴 29, 2 unch. · avg -8.1%
closures.js — Interp: 🟢 1, 🔴 1, 9 unch. · avg +0.2% · Bytecode: 🔴 10, 1 unch. · avg -8.5%
collections.js — Interp: 🔴 2, 10 unch. · avg -0.5% · Bytecode: 🔴 12 · avg -11.0%
csv.js — Interp: 🔴 1, 12 unch. · avg -2.0% · Bytecode: 🔴 13 · avg -9.1%
destructuring.js — Interp: 🟢 1, 🔴 1, 20 unch. · avg -0.1% · Bytecode: 🔴 22 · avg -9.4%
fibonacci.js — Interp: 🔴 1, 7 unch. · avg -0.6% · Bytecode: 🔴 8 · avg -10.8%
float16array.js — Interp: 🟢 1, 🔴 1, 30 unch. · avg +0.7% · Bytecode: 🔴 30, 2 unch. · avg -9.8%
for-of.js — Interp: 7 unch. · avg -0.5% · Bytecode: 🔴 7 · avg -9.7%
generators.js — Interp: 4 unch. · avg +0.8% · Bytecode: 🔴 4 · avg -9.0%
iterators.js — Interp: 🟢 1, 🔴 13, 28 unch. · avg -0.9% · Bytecode: 🔴 41, 1 unch. · avg -8.2%
json.js — Interp: 🔴 3, 17 unch. · avg -0.7% · Bytecode: 🔴 19, 1 unch. · avg -11.1%
jsx.jsx — Interp: 🟢 3, 18 unch. · avg +2.2% · Bytecode: 🔴 21 · avg -10.5%
modules.js — Interp: 9 unch. · avg +0.7% · Bytecode: 🔴 9 · avg -14.7%
numbers.js — Interp: 11 unch. · avg -0.4% · Bytecode: 🔴 11 · avg -7.9%
objects.js — Interp: 🟢 1, 🔴 1, 5 unch. · avg -1.2% · Bytecode: 🔴 7 · avg -11.1%
promises.js — Interp: 🟢 1, 🔴 2, 9 unch. · avg -0.5% · Bytecode: 🔴 8, 4 unch. · avg -6.5%
regexp.js — Interp: 🔴 2, 9 unch. · avg -1.7% · Bytecode: 🟢 5, 🔴 5, 1 unch. · avg -2.3%
strings.js — Interp: 19 unch. · avg -0.3% · Bytecode: 🔴 19 · avg -11.3%
tsv.js — Interp: 🔴 1, 8 unch. · avg -2.6% · Bytecode: 🔴 9 · avg -9.4%
typed-arrays.js — Interp: 🟢 4, 🔴 9, 9 unch. · avg -12.7% · Bytecode: 🔴 20, 2 unch. · avg -13.5%
uint8array-encoding.js — Interp: 🟢 7, 🔴 4, 7 unch. · avg +14.8% · Bytecode: 🟢 12, 🔴 4, 2 unch. · avg +32.9%
weak-collections.js — Interp: 🟢 8, 🔴 2, 5 unch. · avg +21.5% · Bytecode: 🔴 15 · avg -24.5%
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. |
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@source/app/GocciaBundler.dpr`:
- Around line 104-105: WriteSourceMapIfAvailable currently defaults
MapOutputPath from the original source path (AFileName/SourceName) which causes
.map files to be written beside sources instead of beside the emitted bytecode;
change the default MapOutputPath logic to derive from the resolved/emitted
bytecode output path (the same path ResolveOutputPath/EmitGBC or whatever
produces the .gbc uses) so the .map is written next to the generated .gbc;
update the call site that passes MapOutputPath (where
WriteSourceMapIfAvailable(ASourceMap, MapOutputPath, SourceName, ... ) is
invoked) to compute MapOutputPath from the resolved output filename for the
bytecode (not SourceName/AFileName) and ensure the code that constructs the
default map filename simply replaces the .gbc extension on that resolved output
path with .map.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8d3547d0-e7e7-40e6-a6e4-cb149dd4e9cd
📒 Files selected for processing (9)
docs/architecture.mdsource/app/Goccia.CLI.SourceMaps.passource/app/Goccia.CLI.SourcePipelineResult.passource/app/GocciaBenchmarkRunner.dprsource/app/GocciaBundler.dprsource/app/GocciaREPL.dprsource/app/GocciaScriptLoader.dprsource/app/GocciaTestRunner.dprsource/units/Goccia.SourcePipeline.pas
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@source/app/GocciaBundler.dpr`:
- Around line 138-139: The source-map is being written by
WriteSourceMapIfEnabled(SourcePipelineResult.SourceMap, AFileName, AOutputPath)
before the bytecode is saved via SaveModuleToFile, which can leave a .map for a
missing .gbc; move the call so source maps are emitted only after a successful
bytecode write (e.g., after SaveModuleToFile returns true) or relocate the
WriteSourceMapIfEnabled call into EmitBytecode's success path so both the .gbc
and .map are written together; ensure you check SaveModuleToFile's result and
only call WriteSourceMapIfEnabled when the bytecode save succeeded.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ac5e1ecd-2a97-4446-b802-ee9c0577f890
📒 Files selected for processing (3)
source/app/Goccia.CLI.SourceMaps.passource/app/GocciaBundler.dprsource/app/GocciaScriptLoader.dpr
🚧 Files skipped from review as they are similar to previous changes (1)
- source/app/GocciaScriptLoader.dpr
Summary
Goccia.CLI.SourcePipelineResultas the CLI-owned wrapper around source pipeline parse results.Goccia.CLI.SourceMapsfor shared CLI source-map writing.CONTEXT.md, and document the CLI helper boundary indocs/architecture.md.Testing
Commands run:
./format.pas --checkgit diff --check./build.pas clean loader bundler testrunner benchmarkrunner repl./fixtures/ffi/build.sh./build/GocciaTestRunner tests --no-progress