Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Reset size and tool-cost budgets after moving the layer shaders out of core

Nguyen Xuan An6a7d942456e2
diff --git a/bench/size/baseline.json b/bench/size/baseline.json
index c257bdd7..f8a6b805 100644
--- a/bench/size/baseline.json
+++ b/bench/size/baseline.json
@@ -14,9 +14,9 @@
},
"bundles": {
"entry:core": {
- "min": 283595,
- "gzip": 81018,
- "brotli": 69071
+ "min": 285004,
+ "gzip": 81468,
+ "brotli": 69421
},
"entry:model": {
"min": 40093,
@@ -39,9 +39,14 @@
"brotli": 7331
},
"entry:gltf": {
- "min": 154791,
- "gzip": 47466,
- "brotli": 40652
+ "min": 155888,
+ "gzip": 47824,
+ "brotli": 41448
+ },
+ "entry:gltf+lazy": {
+ "min": 162321,
+ "gzip": 49816,
+ "brotli": 43258
},
"entry:modeling": {
"min": 21149,
@@ -139,29 +144,29 @@
"brotli": 762
},
"entry:agent-scene": {
- "min": 206699,
- "gzip": 63263,
- "brotli": 54923
+ "min": 208967,
+ "gzip": 63945,
+ "brotli": 55786
},
"entry:agent-scene+lazy": {
- "min": 614147,
- "gzip": 210233,
- "brotli": 185269
+ "min": 623239,
+ "gzip": 213035,
+ "brotli": 188048
},
"entry:agent-asset": {
- "min": 300910,
- "gzip": 93744,
- "brotli": 81565
+ "min": 303069,
+ "gzip": 94728,
+ "brotli": 82813
},
"entry:agent-asset+lazy": {
- "min": 650097,
- "gzip": 220739,
- "brotli": 193778
+ "min": 659080,
+ "gzip": 223845,
+ "brotli": 196982
},
"entry:hdri": {
"min": 8075,
"gzip": 3138,
- "brotli": 2801
+ "brotli": 2802
},
"entry:camera-effects": {
"min": 23985,
@@ -173,25 +178,35 @@
"gzip": 1608,
"brotli": 1425
},
+ "entry:material-layer-shaders": {
+ "min": 71379,
+ "gzip": 18505,
+ "brotli": 16205
+ },
"scene:lit-box": {
- "min": 214877,
- "gzip": 58928,
- "brotli": 50227
+ "min": 215844,
+ "gzip": 59286,
+ "brotli": 50588
},
"scene:gltf-box": {
- "min": 273787,
- "gzip": 78107,
- "brotli": 67034
+ "min": 275471,
+ "gzip": 79332,
+ "brotli": 68903
+ },
+ "scene:gltf-box+lazy": {
+ "min": 281904,
+ "gzip": 81319,
+ "brotli": 70712
},
"scene:agent-scene": {
- "min": 315953,
- "gzip": 92416,
- "brotli": 79459
+ "min": 318701,
+ "gzip": 94262,
+ "brotli": 81921
},
"scene:agent-scene+lazy": {
- "min": 723401,
- "gzip": 239390,
- "brotli": 209757
+ "min": 732973,
+ "gzip": 243364,
+ "brotli": 214130
}
}
}
diff --git a/bench/size/budgets.json b/bench/size/budgets.json
index facb2f43..1aa0ba7a 100644
--- a/bench/size/budgets.json
+++ b/bench/size/budgets.json
@@ -6,12 +6,13 @@
"agent-scene": 100000
},
"budgets": {
- "entry:core": 82700,
+ "entry:core": 83100,
"entry:model": 14400,
"entry:nature": 13200,
"entry:motion": 13600,
"entry:canvas2d": 9400,
- "entry:gltf": 48500,
+ "entry:gltf": 48800,
+ "entry:gltf+lazy": 50900,
"entry:modeling": 8700,
"entry:sculpt": 2500,
"entry:surface": 10100,
@@ -31,16 +32,18 @@
"entry:light-bake": 25400,
"entry:path-tracer": 12900,
"entry:texture-set": 900,
- "entry:agent-scene": 64600,
- "entry:agent-scene+lazy": 214500,
- "entry:agent-asset": 95700,
- "entry:agent-asset+lazy": 225200,
+ "entry:agent-scene": 65300,
+ "entry:agent-scene+lazy": 217300,
+ "entry:agent-asset": 96700,
+ "entry:agent-asset+lazy": 228400,
"entry:hdri": 3300,
"entry:camera-effects": 8600,
"entry:render-passes": 1700,
- "scene:lit-box": 60200,
- "scene:gltf-box": 79700,
- "scene:agent-scene": 94300,
- "scene:agent-scene+lazy": 244200
+ "entry:material-layer-shaders": 18900,
+ "scene:lit-box": 60500,
+ "scene:gltf-box": 81000,
+ "scene:gltf-box+lazy": 83000,
+ "scene:agent-scene": 96200,
+ "scene:agent-scene+lazy": 248300
}
}
diff --git a/bench/tool-cost-budgets.json b/bench/tool-cost-budgets.json
index 864fd28e..361284cd 100644
--- a/bench/tool-cost-budgets.json
+++ b/bench/tool-cost-budgets.json
@@ -1,5 +1,5 @@
{
- "measured": "2026-10-31, from scripts/measure-tool-cost.mjs; raised by 800 total and 150 for scene_apply for branch and labels fields (no new tool); raised by 650 total and 80 for scene_apply for clip layers, bone masks and retargeting through MCP; raised by 20 for scene_create and 20 for the scene_capabilities result after merging the expression language with the material graph; was 373388 schema bytes before shared IDs and recipe references; trimmed after the render-passes merge: material graph, depth of field, motion blur and passes details moved to scene_capabilities, budgets set to the measured value plus 0.5% (total 188267, scene_capabilities result 5167); raised by 95 for scene_apply and 690 for the scene_capabilities result for node relations; curve and text geometry entries shortened to a pointer at scene_capabilities curveText, budgets set to the measured value plus 0.5% (total 189468, scene_capabilities result 6399); then six modifier ops (weld, triangulate, edge_split, smooth, simple_deform, cast) added as one compact schema entry with details in scene_capabilities meshModifiers, entry and mesh_stack description shortened: total 190382 (budget unchanged at 190420), mesh_edit 34216 (budget 34220), scene_capabilities result 7042 (budget 7050); mesh_stack 11682 (budget 11690); after merging imported mesh topology with the modifier ops: raised the total to 190480 (measured 190471), mesh_edit to 34300 (measured 34293) and the scene_capabilities result to 7520 (measured 7512) for imported mesh edits; then cloth (recipe cloth, set-cloth, grid geometry) added with the total unchanged at 190480 (measured 189159): physics descriptions shortened and set-physics now takes the same record reference as set-motion, scene_create raised to 62150 and scene_apply lowered to 44130, scene_capabilities result raised to 8190 (measured 8176) for the cloth details; then particles and hair (recipe `particles`, set-particles) added with the total unchanged at 190480 (measured 189642, scene_create raised to 62350 and scene_apply to 44370 for the recipe particles reference and set-particles): the section is one record reference described in scene_capabilities, so the scene_capabilities result rose to 9570 (measured 9523) for the particle and hair fields; after merging the film timeline (recipe timeline, set-timeline) with particles: total 190719 (budget 190730), scene_create 62464, scene_apply 44620, scene_capabilities result 9902; then the path tracer renderer setting (drop z.int bounds, integers still checked by the job validator): total raised to 190830 (measured 190818); after merging the render limits and light bake with the path tracer: measured total 190013, scene_create raised to 62680 (measured 62667), scene_apply to 44860 (measured 44852) and the scene_capabilities result to 10620 (measured 10613) for the bake section and job size limits",
+ "measured": "2026-10-31, from scripts/measure-tool-cost.mjs; raised by 800 total and 150 for scene_apply for branch and labels fields (no new tool); raised by 650 total and 80 for scene_apply for clip layers, bone masks and retargeting through MCP; raised by 20 for scene_create and 20 for the scene_capabilities result after merging the expression language with the material graph; was 373388 schema bytes before shared IDs and recipe references; trimmed after the render-passes merge: material graph, depth of field, motion blur and passes details moved to scene_capabilities, budgets set to the measured value plus 0.5% (total 188267, scene_capabilities result 5167); raised by 95 for scene_apply and 690 for the scene_capabilities result for node relations; curve and text geometry entries shortened to a pointer at scene_capabilities curveText, budgets set to the measured value plus 0.5% (total 189468, scene_capabilities result 6399); then six modifier ops (weld, triangulate, edge_split, smooth, simple_deform, cast) added as one compact schema entry with details in scene_capabilities meshModifiers, entry and mesh_stack description shortened: total 190382 (budget unchanged at 190420), mesh_edit 34216 (budget 34220), scene_capabilities result 7042 (budget 7050); mesh_stack 11682 (budget 11690); after merging imported mesh topology with the modifier ops: raised the total to 190480 (measured 190471), mesh_edit to 34300 (measured 34293) and the scene_capabilities result to 7520 (measured 7512) for imported mesh edits; then cloth (recipe cloth, set-cloth, grid geometry) added with the total unchanged at 190480 (measured 189159): physics descriptions shortened and set-physics now takes the same record reference as set-motion, scene_create raised to 62150 and scene_apply lowered to 44130, scene_capabilities result raised to 8190 (measured 8176) for the cloth details; then particles and hair (recipe `particles`, set-particles) added with the total unchanged at 190480 (measured 189642, scene_create raised to 62350 and scene_apply to 44370 for the recipe particles reference and set-particles): the section is one record reference described in scene_capabilities, so the scene_capabilities result rose to 9570 (measured 9523) for the particle and hair fields; after merging the film timeline (recipe timeline, set-timeline) with particles: total 190719 (budget 190730), scene_create 62464, scene_apply 44620, scene_capabilities result 9902; then the path tracer renderer setting (drop z.int bounds, integers still checked by the job validator): total raised to 190830 (measured 190818); after merging the render limits and light bake with the path tracer: measured total 190013, scene_create raised to 62680 (measured 62667), scene_apply to 44860 (measured 44852) and the scene_capabilities result to 10620 (measured 10613) for the bake section and job size limits; then material layers anisotropy and iridescence (issue #51): the 16 layer fields take one short line each in the schema and their ranges and notes moved to scene_capabilities scene.materialLayers, so the scene_capabilities result rose to 12230 (measured 12168)",
"schemaTotalBytes": 190830,
"schemaToolBytes": {
"scene_create": 62680,
@@ -10,7 +10,7 @@
},
"schemaOtherToolBytes": 4000,
"resultBytes": {
- "scene_capabilities": 10620,
+ "scene_capabilities": 12230,
"scene_create": 1400,
"scene_inspect": 1400,
"mesh_inspect": 1200,
diff --git a/tests/material-layer-shaders.test.js b/tests/material-layer-shaders.test.js
index d2dbc308..fa76d99b 100644
--- a/tests/material-layer-shaders.test.js
+++ b/tests/material-layer-shaders.test.js
@@ -21,8 +21,8 @@ test('the static graph of the core shaders does not reach the layer shader modul
test('a layer without registered code fails with the import to add', async () => {
const { createFragmentShader, fragmentShader } = await import('../src/shaders.js?without-layer-code');
assert.doesNotMatch(fragmentShader, /anisotropicSpecular|filmReflectance/);
- assert.throws(() => createFragmentShader(['anisotropy']), /anisotropy material layer needs its shader code.*addons\/material-layer-shaders/);
- assert.throws(() => createFragmentShader(['iridescence']), /iridescence material layer needs its shader code.*addons\/material-layer-shaders/);
+ assert.throws(() => createFragmentShader(['anisotropy']), /anisotropy layer needs its shader code.*addons\/material-layer-shaders/);
+ assert.throws(() => createFragmentShader(['iridescence']), /iridescence layer needs its shader code.*addons\/material-layer-shaders/);
assert.doesNotThrow(() => createFragmentShader(['water']));
});