Skip to content

Boot 8.7 s → 4.4 s: parallel character decode + EN-055 anim instances - #32

Merged
proggeramlug merged 4 commits into
mainfrom
feat/en-055-fast-boot
Jul 16, 2026
Merged

Boot 8.7 s → 4.4 s: parallel character decode + EN-055 anim instances#32
proggeramlug merged 4 commits into
mainfrom
feat/en-055-fast-boot

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Depends on engine PR #107 (instantiateAnimation + the two staged-commit quality fixes). Merge that first.

SH-049 told us to attack the aliens = 5.5 s of boot, blamed on per-SLOT ModelAnimation loads. Sub-timing says the attribution was wrong: all animation parsing was 43 ms — the 4.9 s was seven serial loadModel calls PNG-decoding character textures on the main thread.

What changed

  • All 8 character GLBs decode in parallel worker threads (stageModels) at BOOT_PLAYER; the player and the aliens commit their staged handles where they used to load.
  • Per-slot anim handles are EN-055 instances over the per-kind clip set — same independence guarantee, zero duplicate parses.
  • New [anim] boot-log line proves live instance handles (like the [music] probe — silent failure here would look like frozen enemies).
  • SH-049's registry entry carries the correction.

Measured

stage before after
TOTAL 8,702 ms 4,372 ms
the aliens 5,098 ms 214 ms
the marine 1,190 ms 1,777 ms (hosts the whole parallel batch)

Verified (quality-neutral by evidence, not assumption)

  • Title F12 capture: the bsuit's normal/MR/emissive maps are pixel-faithful through the staged path — the exact maps the engine fixes protect.
  • AITEST batch run: enemies spawn from staged models, close 57 m → melee, cycle AI states, zero errors.

Note: this branch touches the same main.ts/enemies.ts regions as #28/#30 — whichever merges last takes a trivial conflict resolution (import lists).

SH-049 said 'the aliens is 5.5 s of boot - a ModelAnimation per SLOT.
That is the one number to attack.' Attacked, and the attribution was
wrong: sub-timed, ALL animation parsing was 43 ms (load_gltf_animation
never decodes images). The 4.9 s was seven SERIAL loadModel calls
PNG-decoding ~25 character textures on the main thread.

- All 8 character GLBs (player + 7 kinds) now decode in parallel worker
  threads at BOOT_PLAYER via stageModels(), and each stage commits its
  handles where it used to load: main commits the player, initEnemyPool
  commits the aliens. Requires engine PR #107, which fixed the two
  staged-commit bugs that would have silently degraded quality (aux
  texture remap dropped normal/MR/emissive/occlusion maps; normal maps
  registered through the sRGB path instead of register_texture_kind).
- Per-slot animation handles are EN-055 instances over the per-kind
  clip set (instantiateAnimation) - same independence guarantee (own
  mixer, own joint state), no duplicate parses. New [anim] boot log
  line proves the instances are live handles (0 = dead), same rationale
  as the [music] probe.
- docs/tickets.md SH-049 carries the correction, so the wrong 61%
  attribution cannot cost anyone else an afternoon.

Measured (BOOT_TIMING, same box, same stages):
  TOTAL        8702 -> 4372 ms
  the aliens   5098 ->  214 ms   (commits 160 ms + anims 32 ms + slots 2 ms)
  the marine   1190 -> 1777 ms   (hosts the whole parallel decode batch)

Verified: title-screen F12 capture - the bsuit's normal/MR/emissive
maps render pixel-faithful through the staged path (the exact surface
the engine fixes protect); AITEST batch run - enemies spawn from staged
models, close 57 m to melee, cycle AI states, zero errors; [anim]
clipset=2 slot0=9 slot1=10 on the boot log.
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@proggeramlug, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5e620ef0-3dcc-488d-a9f0-9ea01829277a

📥 Commits

Reviewing files that changed from the base of the PR and between 1a40d23 and 2cdbabb.

⛔ Files ignored due to path filters (2)
  • dxcompiler.dll is excluded by !**/*.dll
  • dxil.dll is excluded by !**/*.dll
📒 Files selected for processing (5)
  • CLAUDE.md
  • docs/tickets.md
  • src/director.ts
  • src/enemies.ts
  • src/main.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/en-055-fast-boot

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Ralph Kuepper added 3 commits July 16, 2026 12:08
…-cache

Deleting the documented-but-wrong path is a no-op; it faked a
stale-build conclusion during the EN-055 work before the real cache
was found in the compile log's own 'Reused cached object' lines.
Two things the textually-clean auto-merge would have shipped broken:
- #28 removed KIND_COUNT/ALIEN_GLB from main.ts imports; this branch's
  stageModels batch uses both. Re-added - a green Perry compile does not
  catch absent cross-module imports (ReferenceError at boot).
- This branch (and #30) accidentally committed dxcompiler.dll/dxil.dll:
  both were branched before #29's .gitignore landed, so 'git add -A'
  swept the untracked DLLs in, and #30's merge carried them onto main.
  Untracked again here (files stay on disk - the game needs them beside
  the exe; see EN-058).

Verified on the merged tree: compile green, 14 s batch run boots to the
menu with [music] menu=1 calm=2 combat=3 and [anim] clipset=2 slot0=9
slot1=10 both live.
@proggeramlug
proggeramlug merged commit 036b722 into main Jul 16, 2026
1 check was pending
@proggeramlug
proggeramlug deleted the feat/en-055-fast-boot branch July 16, 2026 10:23
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