fix(sim): bound the rendition ladder the transcoder will act on - #62
Merged
Conversation
|
@kevin9327 is attempting to deploy a commit to the whoarrryou's projects Team on Vercel. A member of the Team first needs to authorize it. |
This was referenced Sep 6, 2026
Owner
|
Confirmed the hang on main, Infinity really does lock it up rather than just run slow. LGTM, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A design carrying a
renditionscount larger than the inspector can set does not make the farm slow,it ends the process. The ladder is a loop that runs once per rendition per outgoing edge for every
finished job:
and the count it runs to is read like this:
Infinity >= 1is true andMath.floorleaves it alone, so the loop above has no end for it. Alarge finite count has no ceiling either.
Measured
Running the decoded topology through the engine for 120 ticks:
Against
mainthe new test file cannot finish. The worker exits rather than reporting:Where it comes from
Not the inspector: its number input stops at 12.
isTopologychecks the nine core config numbers —capacity,serviceMs,serviceCv,queueLimit,hitRate,errorRate,timeoutMs,retries,rps— and notrenditions, so a shared link, a.breakscalefile and a restored session carry itthrough untouched.
Fix
cfgRenditionsrejects anything that is not a finite number and caps atMAX_RENDITIONS = 12, themaximum the inspector already offers. A ladder is a small number by nature — 1080p, 720p, 480p — so
the ceiling is not a compromise, it is the shape of the thing.
The fallback of 3 and the
v < 1behaviour are unchanged.Tests
src/sim/behaviour-resilience.bounds.test.ts, new. The ladder is observable as write amplificationon the store behind the farm, which is the lesson the component exists to teach, so that is what the
tests read:
Infinityand of1e9both run, in well under a secondof three means where the number is visible
changed nothing a reader can reach
How I tested
Windows 11, Bun 1.3.14.
bun run testis 933 passed across 40 files, up from 929 by the four newtests, with nothing else moving.
bun run typecheck,bun run lintandbun run format:checkareclean.
Same shape as #58, and a sibling of #60 (data-tier counts) and #61 (broker partitions). All three
touch different files and none depends on the others.