Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Merge remote-tracking branch 'origin/main' into chore/presets-and-timing

Nguyen Xuan An8a7afef928e9
diff --cc CHANGELOG.md
index ffc01290,7733d585..21127810
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -2,8 -2,8 +2,10 @@@
## Unreleased
+- Score the recipe bake presets against Cycles (part of issue #170, open for the frame costs). `standard` scores 0.127 to 0.159 on the three rooms (no bake 0.51), `fine` is no better, and `standard` and `fine` refuse `temple-hall`. Table in `bench/reference/README.md`.
+- No test asserts real elapsed time any more (issue #179): work counts and a fake clock replace stopwatches. `smoke:agent-review-close` and `smoke:film-physics` are wired; the second starts its own server.
+ - Show the floor and the other parts in smooth metal (part of issue #167, which stays open). `traceObjectProbes` in `src/probe-trace.js` gives each part with `metallic` of at least 0.5 and `roughness` of at most 0.6 a reflection probe of its own, traced from the middle of the part without it (up to 8 parts, lit by direct light and the environment's diffuse light), and `placeProbes` assigns it. `metal` scores 0.1294 to 0.1036 against Cycles (EEVEE 0.0916), `brushed-film` 0.1149 to 0.1029, `car-paint` 0.1059 to 0.1038, `material-spheres` 0.1312 to 0.1293; every scene without a reflective part is unchanged to four digits and draws the same frame (`metal` 1.51 ms plain, 1.58 ms with four probes). `npm run reference -- --object-probes` places them (opt in; the committed baseline is unchanged); recipes do not yet.
+
- Make every test file pass on its own, and check it in CI (issue #172). `node --test tests/agent-bake.test.js` failed 16 of 19 because `npm test` preloaded every on-demand module into each test process, so 28 files only passed through that preload. The loading path agents use was fine (`tests/agent-scene-on-demand.test.js` runs it in clean processes). Each of those files now imports `tests/support/load-agent-scene-modules.mjs` itself, `npm test` no longer preloads, and `npm run test:isolated` (`scripts/test-each-file.mjs`) runs each file in its own process, 4 at a time at below-normal priority, rerunning a failure alone once so a busy machine does not count. It runs in the `Test` workflow.
- Fix links in the npm package that pointed at docs it does not ship (issue #178). `docs/guide.md`, `docs/material-maps.md`, `README.md` and `ROADMAP.md` now link the 20 unshipped docs, `CONTRIBUTING.md`, the texture credits and the changelog by absolute GitHub URL; shipping those docs would add 64 KB gzip. `npm run check:links:package` packs the archive, unpacks it and checks every link inside (26 files, 0 broken), and the `Test` workflow runs it.
- Take 34 KB of headroom under the npm archive budget without raising it (issue #177). `CHANGELOG.md` no longer ships in the package, because GitHub serves it; the archive went from 740,972 to 705,961 bytes against the 740,000 budget. `bench/size/README.md` now says how the budget is set and what it protects.
diff --cc bench/reference/run.mjs
index f8bec566,11e72922..513c0f74
--- a/bench/reference/run.mjs
+++ b/bench/reference/run.mjs
@@@ -87,9 -87,12 +91,12 @@@ async function renderBackend(backend, s
await openHarness();
const started = performance.now();
const describe = backend === 'gpu';
- const probes = probesFlag >= 0 && (probedSceneIds === null || probedSceneIds.includes(id));
+ const probesThisScene = probesFlag >= 0 && (probedSceneIds === null || probedSceneIds.includes(id));
const bakesThisScene = bakeFlag >= 0 && (bakedSceneIds === null || bakedSceneIds.includes(id));
+ // Object probes are opt in: a recipe does not place them yet, so the baseline scores what a user gets by default.
+ const objectProbesThisScene = objectProbesFlag >= 0 && (objectProbeSceneIds === null || objectProbeSceneIds.includes(id));
+ const probes = objectProbesThisScene ? 'objects' : probesThisScene;
- const bake = bakesThisScene ? { ...skyOnlyOptions } : null;
+ const bake = bakesThisScene ? { ...skyOnlyOptions, ...(bakePreset ? { preset: bakePreset } : {}) } : null;
const result = await page.evaluate(([sceneId, shouldDescribe, ambientOcclusion, ambientOcclusionRadius, bakeOptions, cascadeCount, withProbes, ambientScale]) => window.renderReferenceScene(sceneId, { describe: shouldDescribe, ambientOcclusion, ambientOcclusionRadius, bake: bakeOptions, cascades: cascadeCount, probes: withProbes, ambient: ambientScale }), [id, describe, ambientOcclusion, ambientOcclusionRadius, bake, cascades, probes, ambient]);
if (result.glError !== 0) throw new Error(`${id} on ${backend} gave WebGL error ${result.glError}.`);
graphics[backend] = result.graphics;