Nondeterministic codegen: Next.js app-page-turbo.runtime.prod.js and server.js objects differ between identical compiles
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript, rust, typescript
- Domain
- build-system, compilers, performance
Research direction
Start with the cpar lane’s full.sh setup and reproduce by compiling the Next.js standalone server twice with PERRY_NO_AUTO_OPTIMIZE=1, then compare per-module objects. Trace id or symbol-suffix assignment during lowering or codegen for app-page-turbo.runtime.prod.js and server.js; the issue does not name the responsible source file or test location. Done means identical inputs produce byte-identical objects across runs and a fixture test verifies this.
Written by the indexing model from the issue text.
Description
Found by the cpar lane (compile parallelism) while checking byte-identity.
Compiling the same Next.js standalone input three times on the same base (b3fed79c8a lineage, before the scheduler change) gives different module objects for app-page-turbo.runtime.prod.js and server.js. Every other module (762 of 764) is byte-identical across runs. The diff shows wrapper and object-method numbering that changes between runs. That points to iteration over an unordered container (e.g. a HashMap/HashSet) when ids or symbol suffixes are assigned during lowering or codegen for those modules.
Why it matters: object caching and A/B measurement both assume that the same input gives the same bytes.
Repro: compile the Next standalone server (env as in the nextrun lane's full.sh) twice with PERRY_NO_AUTO_OPTIMIZE=1, then md5 the per-module objects. Fix: give the id/suffix assignment a deterministic order (source order, or a sort by a stable key), then add a test that compiles a fixture twice and compares the objects.
- Dominant language
- Rust
- Stars
- 4.9k
- Forks
- 166
- Avg merge
- 3h 23m
- Merged PRs (30d)
- 911
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PerryTS/perry
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
Maintainers usually reply within 1 day
Similar issues
-
Make major, minor, and makedev safe on solarish targetsPossibly taken @xtqqczze claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Proxy ignores l5d-retry-http and l5d-retry-grpc conditions that follow a comma and spacePossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 3 days
-
sncast panics when decoding a `u384` valuePossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
foundry-rs/starknet-foundry#4635 ·
Maintainers usually reply within 3 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
crmne/omastats#31 · 1 reaction ·
Maintainers usually reply within 1 day
-
area:desktop priority:p2 type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day