Skip to content

test(compiler): Guard function-reference indexing against rescans - #1577

Open
MathurAditya724 wants to merge 4 commits into
vercel-labs:mainfrom
MathurAditya724:codex/hoisting-reference-index
Open

MathurAditya724 wants to merge 4 commits into
vercel-labs:mainfrom
MathurAditya724:codex/hoisting-reference-index

Conversation

@MathurAditya724

@MathurAditya724 MathurAditya724 commented Oct 20, 2026 •

Copy link
Copy Markdown

Adds regression coverage for function-reference indexing in early-read var analysis, found while compiling the complete Sentry CLI dependency bundle with scriptc. The background and original analysis timings are in #1797.

Main now provides the optimization in 70aed0f13. This branch preserves that lazy name-index implementation exactly. The remaining diff is the regression test file: production compiler code matches main at daac2a4a1.

The tests verify that whole-file analysis traversals stay constant between 12- and 48-link function chains, and that shadowed names, duplicate declarations, shorthand references, and immutable source-file snapshots retain their binding behavior. The scan test measures the analysis directly, excludes the fixture's name-collection traversal, and requires a positive count so it cannot pass without observing the analysis.

After a frozen-lockfile install with CI's Node 24.22.0 and pnpm 11.1.3, the merged head passes all seven focused hoisting tests, 35 code-quality/CI-policy contracts, workspace build, lint, formatting, and generated AST drift checks locally. This PR's current diff adds tests; the historical timing improvement belongs to the implementation now on main. Full Sentry CLI parity and runtime benchmarks remain outstanding.

Hosted CI run is awaiting maintainer approval for this fork; no Actions test jobs have run. Vercel preview deployment also requires authorization.

Refs #1797.

Co-Authored-By: GPT-6 <noreply@openai.com>
@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

@MathurAditya724 is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Merge main while retaining its lazy function-reference index. Keep the regression tests and measure only analysis traversals in the scan-count assertion.

Refs vercel-labs#1797

Co-Authored-By: GPT-6 <noreply@openai.com>
@MathurAditya724 MathurAditya724 changed the title perf(compiler): Reuse function reference indexing test(compiler): Guard function-reference indexing against rescans Oct 22, 2026
MathurAditya724 and others added 2 commits October 22, 2026 19:58
Retain the upstream reference-index implementation and its focused regression tests.

Co-Authored-By: GPT-6 <noreply@openai.com>
Keep production sources identical to main while retaining reference-index regression coverage.

Co-Authored-By: GPT-6 <noreply@openai.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant