methodcert: tsc .text +75 KB from register spills at uncertified class-dispatch sites
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 18/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust, typescript
- Domain
- compilers, performance
Research direction
Start on the methodcert branch and reproduce the .text growth on tsc, then diff the LLVM register allocation of closure 16216 between base and head using -print-after=greedy. Find which values are live across the js_method_site_miss call and the receiver-word probe at uncertified class-dispatch sites. Done means explaining the spill increase and showing a change to the emission shape that brings the tsc .text growth back down.
Written by the indexing model from the issue text.
Description
Follow-up to the method-certificate change (branch methodcert, class dispatch through epoch-bearing method certificates).
What happens
With the certificate change, tsc's .text grows by +75,264 B, while instructions:u change by only +0.004%.
- Runtime symbols: the same size in both arms. All of the growth is in compiled JS functions: 101 grew and 59 shrank.
- LLVM input: 5.1% smaller on head. 5,130 old tower sites are gone, and no tsc site is certified, because tsc's classes have no statically named prototype chain.
- Machine code: larger anyway. The extra code is register spill and reload. For the largest grower, closure 16216:
| base | head | |
|---|---|---|
| IR lines | 10,787 | 8,738 |
| machine instructions | 4,982 | 6,921 |
| stack references | 380 | 2,063 |
The other programs shrink: Zod −208 KB, Effect −288 KB, fastify −93 KB, commander −23 KB.
Likely cause (to confirm)
At an uncertified site, the new receiver-word probe and miss call change the register-allocation picture: values become live across the generic call. There is no shared Rust helper whose inlining explains this, so #[inline(never)] doesn't apply.
Next step
- Diff the regalloc of closure 16216 between arms, for example with
-print-after=greedyon that function. Find which values are live acrossjs_method_site_missor the probe. - Fix it in the emission shape. For example, keep the slow path out of line so the hot block keeps its live ranges.
- 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