Warn on over-budget model triangle counts; drive --state - #1756
Merged
Merged
Conversation
The GLB loader counts each model's triangles as it lands, warns once per URL above DEFAULT_MODEL_TRIANGLE_BUDGET (100k, retunable with setModelTriangleBudget), and exposes heavyModels() plus a debug_snapshot probe so a heavy prop is assertable evidence instead of a slow frame. drive gains --state <name> to boot a capture.states entry like shoot does. Refs #1345 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Refs #1345. The tower-guard playtest reported ~700k-triangle tower models; nothing in the engine would have said so either way. The models turned out to be 557–732 triangles each, but a heavy model still only shows up as a slow frame.
packages/shell/src/render/modelLoad.ts:countSceneTriangles,recordModelTriangles,heavyModels,clearHeavyModels,setModelTriangleBudget,DEFAULT_MODEL_TRIANGLE_BUDGET(100k).DiagnosticGLTFLoadercounts every loaded GLB and warns once per URL over budget.packages/shell/src/devtools/DevtoolsOverlay.tsx:probes.heavyModelsindebug_snapshot.scripts/drive-dev.ts:--state <name>boots acapture.statesentry likeshoot --state, so a staged scene can be measured with--rpc debug_snapshot/--probe.CHANGELOG.md,.claude/skills/jgengine-ui/{api,capabilities}.md: entries and generated docs.Root cause: the loader had a fallback probe and a texture-error probe but no size probe, so a heavy asset was undetectable except by frame time.
Verification
bun test packages/shell/src/render packages/shell/src/devtools— 110 passbun --cwd=packages/shell run check-types— cleanbun run gen— 5 stages passedbun run ship:preflight— okbun run drive tower-guard --state two-towers --rpc '{"method":"debug_snapshot"}'—probes.heavyModels: []with the KayKit towers loadedNo screenshots: a console warning and a probe field have no rendered surface.
🤖 Generated with Claude Code