3D engine that AI agents drive
Count placed assets and generated geometry in the render estimate, trim the concise report (#905)
Nguyen Xuan An8e873c2be782
diff --git a/docs/mcp.md b/docs/mcp.mdindex 5c713eb6..58392305 100644--- a/docs/mcp.md+++ b/docs/mcp.md@@ -192,13 +192,13 @@ Imported clip sampling remains available through `set-animation`.### Render estimate and report-`scene_render_submit` returns `estimate` beside the job record, so an agent can see what a job costs on this device before it waits for it: `seconds`, `peakMemoryMiB` (Node plus browser heap), `framesPerSecond`, `basis` and the scene numbers it used (`parts`, `triangles` counting every placed node, `materials`, `textures`, `lights`). `scene_capabilities` topic `jobs` has the one-line summary.+`scene_render_submit` returns `estimate` beside the job record, so an agent can see what a job costs on this device before it waits for it: `seconds`, `peakMemoryMiB` (Node plus browser heap), `framesPerSecond`, `basis` and the scene numbers it used (`parts`, `triangles` counting every placed node and the geometry of placed assets, vegetation and crowds (the larger of the node list and half the resident vertex count), `materials`, `textures`, `lights`). `scene_capabilities` topic `jobs` has the one-line summary.The estimate is a fixed cost model in `scripts/agent-render-estimate.mjs` (`COST_MODEL`): a start-up cost, a scene build cost per triangle, a per-frame cost from pixels, triangles, lights and passes, and for the path tracer a cost per pixel, sample and bounce (capped by `renderer.maxSeconds`) plus a build cost per triangle. The first GPU path trace in a server process adds about 10 s for its kernel. The same scene and settings always give the same numbers. The constants were fitted to jobs measured with `node scripts/measure-render-estimate.mjs`, which renders a small, a medium and a large scene and prints estimate against measurement; run it again after changing the model.-The runtime keeps the last 16 jobs on this machine in `render-history.json` in the jobs folder: each entry holds the model's estimate and the measurement of one finished job, with its kind (raster or path tracer, image or video, backend). Once two jobs of the same kind are there, the estimate is multiplied by the median measured-over-estimated ratio of those jobs, never by more than 4 either way, and `basis` says so. The file stays on the machine; a damaged file counts as no history. `modelSeconds` and `modelPeakMemoryMiB` are the numbers before this correction.+The runtime keeps the last 16 jobs run from this jobs folder in `render-history.json`: each entry holds the model's estimate and the measurement of one finished job, with its kind (raster or path tracer, image or video, backend). Once two jobs of the same kind are there, the estimate is multiplied by the median measured-over-estimated ratio of those jobs, never by more than 4 either way, and `basis` says so, including when the time factor hit the 4x limit and when memory had too little history of its own. A job that ran at a smaller size than requested (the memory budget cut the frame) is not recorded. The file stays on the machine; a damaged file counts as no history. `modelSeconds` and `modelPeakMemoryMiB` are the numbers before this correction.-When a job completes, `scene_render_result` has `metrics.report`, one record of what happened: `measured` (`seconds`, `peakMemoryMiB`, `frames`, `secondsPerFrame`), the `estimate` it was compared with and `secondsRatio` (measured over estimated), `samplesDrawn` and `samplesRequested` for a path trace, and `fallbacks`, a list of sentences for everything that ran differently from the request (a frame cut down to fit `--memory`, a backend that fell back, a denoiser that was swapped). `report` stays in the concise answer; the raw counters it is built from (`peakNodeBytes`, `peakBrowserHeap`, `elapsedSeconds`) are in the detailed one.+When a job completes, `scene_render_result` has `metrics.report`, one record of what happened: `measured` (`seconds`, `peakMemoryMiB`, `frames`, `secondsPerFrame`), the `estimate` it was compared with and `secondsRatio` (measured over estimated), `samplesDrawn` and `samplesRequested` for a path trace, and `fallbacks`, a list of sentences for everything that ran differently from the request (a frame cut down to fit `--memory`, a backend that fell back, a denoiser that was swapped). The concise answer keeps only `seconds`, `secondsRatio` and `fallbacks` of it; the detailed answer has the whole record and the raw counters it is built from (`peakNodeBytes`, `peakBrowserHeap`, `elapsedSeconds`).Limits of the estimate: it covers a job's own time, not the wait for a busy machine; memory is the sampled Node RSS plus the browser JS heap, which is a lower bound for GPU memory; path tracer estimates assume the CPU or GPU backend named in the settings, and a native tracer that cannot run falls back (see `fallbacks`).diff --git a/scripts/agent-render-estimate.mjs b/scripts/agent-render-estimate.mjsindex 568ef5a4..3e3fc999 100644--- a/scripts/agent-render-estimate.mjs+++ b/scripts/agent-render-estimate.mjs@@ -22,6 +22,9 @@ const MINIMUM_HISTORY_RUNS = 2;export const COST_MODEL = Object.freeze({startupSeconds: 0.25,setupSecondsPerTriangle: 3.3e-6,+ // A placed asset is rebuilt from its glTF parts (skeleton, materials, textures) however few triangles it has.+ setupSecondsPerAssetPart: 1.2e-3,+ drawSecondsPerAssetPart: 3.5e-5,drawFrameSeconds: 0.004,drawSecondsPerPixel: 5e-8,drawSecondsPerTriangle: 1e-8,@@ -57,9 +60,18 @@ export function sceneSizeFrom(inspection, recipe) {const listed = inspection?.nodes ?? [];const listedTriangles = listed.reduce((total, node) => total + (node.triangles ?? 0), 0);const scale = inspection?.truncated && listed.length ? (inspection.counts?.parts ?? listed.length) / listed.length : 1;+ // The node list leaves out the parts of placed assets, and generated geometry (vegetation, crowds, arrays) has no node of its own;+ // the resident vertex count covers both, so the larger of the two counts stands.+ // Copies of one placed asset share its geometry in that count, so the part of it that no node lists is counted once per copy.+ const residentTriangles = Math.round((inspection?.counts?.vertices ?? 0) / 2);+ const listedScaled = Math.round(listedTriangles * scale);+ const placements = (inspection?.assets ?? []).filter(placement => typeof placement.assetId === 'string');+ const copiesPerAsset = placements.length / Math.max(1, new Set(placements.map(placement => placement.assetId)).size);+ const generatedTriangles = Math.max(0, residentTriangles - listedScaled) * Math.max(1, copiesPerAsset);return {parts: inspection?.counts?.parts ?? 0,- triangles: Math.round(listedTriangles * scale) || Math.round((inspection?.counts?.vertices ?? 0) / 2),+ assetParts: placements.reduce((total, placement) => total + (placement.parts ?? 0), 0),+ triangles: listedScaled + generatedTriangles,materials: inspection?.counts?.materials ?? 0,textures: textureCount(recipe),lights: (look.pointLights ?? 0) + (look.spotLights ?? 0) + (look.areaLights ?? 0) + 1,@@ -80,7 +92,7 @@ function pathTracerFrameSeconds({ size, settings, backend }) {function rasterFrameSeconds({ size, settings }) {const drawSeconds = COST_MODEL.drawFrameSeconds + settings.width * settings.height * COST_MODEL.drawSecondsPerPixel- + size.triangles * COST_MODEL.drawSecondsPerTriangle + size.lights * COST_MODEL.drawSecondsPerLight;+ + size.triangles * COST_MODEL.drawSecondsPerTriangle + size.assetParts * COST_MODEL.drawSecondsPerAssetPart + size.lights * COST_MODEL.drawSecondsPerLight;const outputSeconds = settings.kind === 'video' ? COST_MODEL.videoEncodeSeconds : COST_MODEL.imageCaptureSeconds;return drawSeconds * (1 + (settings.passes?.length ?? 0) * COST_MODEL.passFactor) + outputSeconds;}@@ -109,11 +121,21 @@ function boundedRatio(ratio) {/** Median of measured over estimated, from the last runs of the same kind; 1 when there are too few. */export function correctionFromHistory(history, kind) {const runs = (history ?? []).filter(entry => entry.kind === kind && entry.estimatedSeconds > 0 && entry.measuredSeconds > 0);- if (runs.length < MINIMUM_HISTORY_RUNS) return { seconds: 1, memory: 1, runs: runs.length };- const seconds = boundedRatio(medianOf(runs.map(entry => entry.measuredSeconds / entry.estimatedSeconds)));+ if (runs.length < MINIMUM_HISTORY_RUNS) return { seconds: 1, memory: 1, runs: runs.length, secondsClamped: false, memoryFromHistory: false };+ const rawSeconds = medianOf(runs.map(entry => entry.measuredSeconds / entry.estimatedSeconds));+ const seconds = boundedRatio(rawSeconds);const memoryRuns = runs.filter(entry => entry.estimatedPeakMemoryMiB > 0 && entry.measuredPeakMemoryMiB > 0);const memory = memoryRuns.length >= MINIMUM_HISTORY_RUNS ? boundedRatio(medianOf(memoryRuns.map(entry => entry.measuredPeakMemoryMiB / entry.estimatedPeakMemoryMiB))) : 1;- return { seconds, memory, runs: runs.length };+ return { seconds, memory, runs: runs.length, secondsClamped: seconds !== rawSeconds, memoryFromHistory: memoryRuns.length >= MINIMUM_HISTORY_RUNS };+}++/** Says where the numbers came from: the history is whatever sits in this jobs folder, not a named machine. */+function basisOf(correction, kind) {+ if (correction.runs < MINIMUM_HISTORY_RUNS) return 'scene size';+ const notes = [];+ if (correction.secondsClamped) notes.push(`time factor limited to ${CORRECTION_BOUND}x`);+ if (!correction.memoryFromHistory) notes.push('memory from scene size only');+ return `scene size and the last ${correction.runs} ${kind} jobs in this jobs folder${notes.length ? ` (${notes.join('; ')})` : ''}`;}/**@@ -123,14 +145,14 @@ export function correctionFromHistory(history, kind) {export function estimateRenderJob({ size, settings, backend, memoryBudgetMiB, history = [], gpuTracerWarm = true }) {const frameSeconds = settings.renderer ? pathTracerFrameSeconds({ size, settings, backend }) : rasterFrameSeconds({ size, settings });const coldStartSeconds = settings.renderer?.backend === 'gpu' && !gpuTracerWarm ? COST_MODEL.gpuTracerColdStartSeconds : 0;- const modelSeconds = COST_MODEL.startupSeconds + coldStartSeconds + size.triangles * COST_MODEL.setupSecondsPerTriangle + frameSeconds * settings.frameCount;+ const modelSeconds = COST_MODEL.startupSeconds + coldStartSeconds + size.triangles * COST_MODEL.setupSecondsPerTriangle + size.assetParts * COST_MODEL.setupSecondsPerAssetPart + frameSeconds * settings.frameCount;const modelPeakMemoryMiB = peakMemoryMiB({ size, settings });const correction = correctionFromHistory(history, jobKind(settings, backend));const estimate = {seconds: round(modelSeconds * correction.seconds, 1),peakMemoryMiB: Math.round(modelPeakMemoryMiB * correction.memory),framesPerSecond: round(settings.frameCount / Math.max(0.001, modelSeconds * correction.seconds), 2),- basis: correction.runs >= MINIMUM_HISTORY_RUNS ? `scene size and the last ${correction.runs} ${jobKind(settings, backend)} jobs on this machine` : 'scene size',+ basis: basisOf(correction, jobKind(settings, backend)),modelSeconds: round(modelSeconds, 1),modelPeakMemoryMiB: Math.round(modelPeakMemoryMiB),scene: size,@@ -140,9 +162,13 @@ export function estimateRenderJob({ size, settings, backend, memoryBudgetMiB, hi}/** Facts about what did not run as asked: a budget that shrank the frame, a backend that fell back, a denoiser that was swapped. */+function frameWasReduced(metrics) {+ return Boolean(metrics.width && metrics.requestedWidth && (metrics.width < metrics.requestedWidth || metrics.height < metrics.requestedHeight));+}+function fallbacksFrom(settings, metrics) {const fallbacks = [];- if (metrics.width && metrics.requestedWidth && (metrics.width < metrics.requestedWidth || metrics.height < metrics.requestedHeight)) {+ if (frameWasReduced(metrics)) {fallbacks.push(`The memory budget reduced the frame from ${metrics.requestedWidth}x${metrics.requestedHeight} to ${metrics.width}x${metrics.height}.`);}if (metrics.pathTracer?.backendNote) fallbacks.push(metrics.pathTracer.backendNote);@@ -162,6 +188,7 @@ export function renderReport({ estimate, settings, metrics }) {report.estimate = { seconds: estimate.seconds, peakMemoryMiB: estimate.peakMemoryMiB, basis: estimate.basis };report.secondsRatio = round(measuredSeconds / estimate.seconds, 2);}+ if (frameWasReduced(metrics)) report.frameReduced = true;const traced = metrics.pathTracer;if (traced) {// The path tracer's report describes the last frame; the samples asked for are in the job's settings.@@ -173,7 +200,8 @@ export function renderReport({ estimate, settings, metrics }) {/** The history with this job added, trimmed to the newest HISTORY_LIMIT entries. */export function historyWithJob(history, { settings, backend, estimate, report }) {- if (!estimate || !report.measured.seconds) return history;+ // The estimate was for the requested size, so a job that ran smaller says nothing about it.+ if (!estimate || !report.measured.seconds || report.frameReduced) return history;const entry = {kind: jobKind(settings, backend),estimatedSeconds: estimate.modelSeconds,diff --git a/scripts/mcp-response-format.mjs b/scripts/mcp-response-format.mjsindex 9e03ecad..2f5b6c54 100644--- a/scripts/mcp-response-format.mjs+++ b/scripts/mcp-response-format.mjs@@ -61,6 +61,14 @@ const METRIC_DIAGNOSTICS = ['requestedHeight', 'elapsedSeconds', 'captureSeconds',];+/** What an agent acts on: how long the job took, how far off the estimate was, and anything that ran differently from the request. */+function conciseRenderReport(report) {+ const concise = { seconds: report.measured?.seconds };+ if (report.secondsRatio !== undefined) concise.secondsRatio = report.secondsRatio;+ if (report.fallbacks?.length) concise.fallbacks = report.fallbacks;+ return concise;+}+/** Files with their paths and sizes; digests and the render's resource counters stay in the detailed answer. */export function conciseJobResult(result) {const concise = {@@ -68,7 +76,10 @@ export function conciseJobResult(result) {sourceRevision: result.sourceRevision,artifacts: result.artifacts.map(artifact => without(artifact, ['sha256'])),};- if (result.metrics !== undefined) concise.metrics = without(result.metrics, METRIC_DIAGNOSTICS);+ if (result.metrics !== undefined) {+ concise.metrics = without(result.metrics, [...METRIC_DIAGNOSTICS, 'report']);+ if (result.metrics.report) concise.metrics.report = conciseRenderReport(result.metrics.report);+ }return concise;}diff --git a/scripts/measure-render-estimate.mjs b/scripts/measure-render-estimate.mjsindex 94c59fe0..e4912d07 100644--- a/scripts/measure-render-estimate.mjs+++ b/scripts/measure-render-estimate.mjs@@ -2,9 +2,9 @@// the MCP runtime and prints the estimate next to the measured time and memory as a table.// node scripts/measure-render-estimate.mjs [--backend gpu|cpu] [--json]// On a shared machine run it through your GPU job lock, so it waits for a free card.-import { mkdtemp } from 'node:fs/promises';+import { mkdtemp, mkdir, copyFile } from 'node:fs/promises';import { tmpdir, constants, setPriority } from 'node:os';-import { join, resolve } from 'node:path';+import { basename, join, resolve } from 'node:path';import { setTimeout as delay } from 'node:timers/promises';import { Client } from '@modelcontextprotocol/client';import { StdioClientTransport } from '@modelcontextprotocol/client/stdio';@@ -13,6 +13,10 @@ setPriority(0, constants.priority.PRIORITY_BELOW_NORMAL);const backendArgument = process.argv.indexOf('--backend');const backend = backendArgument > 0 ? process.argv[backendArgument + 1] : 'gpu';const printJson = process.argv.includes('--json');+// --asset <file.glb> adds an asset-heavy scene: ten copies of that model placed from the asset catalog.+const assetArgument = process.argv.indexOf('--asset');+const assetFile = assetArgument > 0 ? resolve(process.argv[assetArgument + 1]) : undefined;+const ASSET_COPIES = 10;const SCENES = [{ name: 'small', spheres: 3, segments: 16, rings: 10, pointLights: 1 },@@ -47,8 +51,13 @@ function recipeFor({ spheres, segments, rings, pointLights }) {}const directory = await mkdtemp(join(tmpdir(), '67js-estimate-'));+const assetDirectory = join(directory, 'assets');+if (assetFile) {+ await mkdir(assetDirectory);+ await copyFile(assetFile, join(assetDirectory, basename(assetFile)));+}const transport = new StdioClientTransport({ command: process.execPath,- args: [resolve('bin/67js-mcp.mjs'), '--backend', backend, '--memory', '256', '--jobs', join(directory, 'jobs')], cwd: directory, stderr: 'pipe' });+ args: [resolve('bin/67js-mcp.mjs'), '--backend', backend, '--memory', '256', '--jobs', join(directory, 'jobs'), ...(assetFile ? ['--assets', assetDirectory] : [])], cwd: directory, stderr: 'pipe' });const client = new Client({ name: '67js-estimate-measure', version: '1' });async function call(name, argumentsValue = {}, timeout = 120000) {@@ -70,8 +79,20 @@ async function untilFinished(jobId) {const rows = [];try {await client.connect(transport);- for (const scene of SCENES) {- const created = (await call('scene_create', { recipe: recipeFor(scene) }, 300000)).structuredContent;+ const scenes = SCENES.map(scene => ({ scene, recipe: recipeFor(scene) }));+ if (assetFile) {+ const catalog = (await call('scene_asset_catalog')).structuredContent;+ const assetId = catalog.assets.find(asset => asset.name === basename(assetFile)).assetId;+ const copies = Array.from({ length: ASSET_COPIES }, (_, index) => ({ id: `copy-${index}`, translation: [index * 2 - ASSET_COPIES, 0, 0], asset: { id: assetId } }));+ scenes.push({ scene: { name: 'asset-heavy', rasterOnly: true }, recipe: {+ format: '67js.scene', schemaVersion: 1,+ geometries: [{ id: 'box', type: 'box' }], materials: [{ id: 'matte', color: [0.7, 0.7, 0.7], roughness: 0.6 }],+ nodes: [{ id: 'floor', geometry: 'box', material: 'matte', translation: [0, -0.1, 0], scale: [30, 0.2, 10] }, ...copies],+ camera: { eye: [0, 6, 16], target: [0, 1, 0], fov: 45 },+ } });+ }+ for (const { scene, recipe } of scenes) {+ const created = (await call('scene_create', { recipe }, 300000)).structuredContent;for (const job of JOBS.filter(job => !(scene.rasterOnly && job.settings.renderer))) {try {const started = performance.now();diff --git a/tests/render-estimate.test.js b/tests/render-estimate.test.jsindex 659b4c51..2ac5d5f6 100644--- a/tests/render-estimate.test.js+++ b/tests/render-estimate.test.js@@ -4,6 +4,7 @@ import { mkdtemp, writeFile, readFile, rm } from 'node:fs/promises';import { tmpdir } from 'node:os';import { join } from 'node:path';import { createAgentRenderJobs, normalizeJobSettings, RENDER_HISTORY_FILE } from '../scripts/agent-render-jobs.mjs';+import { conciseJobResult } from '../scripts/mcp-response-format.mjs';import {CORRECTION_BOUND, HISTORY_LIMIT, correctionFromHistory, estimateRenderJob, historyWithJob, jobKind, parseHistory, renderReport, sceneSizeFrom,} from '../scripts/agent-render-estimate.mjs';@@ -25,7 +26,7 @@ function settingsFor(overrides) {test('scene size counts every placed node, textures and lights', () => {const size = sceneSizeFrom(inspection({ nodeCount: 10, trianglesEach: 1200 }), recipe);- assert.deepEqual(size, { parts: 10, triangles: 12000, materials: 3, textures: 2, lights: 4 });+ assert.deepEqual(size, { parts: 10, assetParts: 0, triangles: 12000, materials: 3, textures: 2, lights: 4 });});test('a truncated node list is scaled up to the part count', () => {@@ -75,7 +76,7 @@ function historyEntry(ratio, kind = 'raster-image-gpu') {}test('history needs two runs of the same kind and moves the estimate by their median', () => {- assert.deepEqual(correctionFromHistory([historyEntry(3)], 'raster-image-gpu'), { seconds: 1, memory: 1, runs: 1 });+ assert.deepEqual(correctionFromHistory([historyEntry(3)], 'raster-image-gpu'), { seconds: 1, memory: 1, runs: 1, secondsClamped: false, memoryFromHistory: false });assert.equal(correctionFromHistory([historyEntry(3), historyEntry(2), historyEntry(1.5)], 'raster-image-gpu').seconds, 2);assert.equal(correctionFromHistory([historyEntry(3), historyEntry(2)], 'raster-video-gpu').runs, 0);const size = sceneSizeFrom(inspection({ nodeCount: 5, trianglesEach: 500 }), recipe);@@ -143,3 +144,51 @@ test('the job store keeps the history file beside its jobs and counts it', asyncawait second.close();assert.equal(JSON.parse(await readFile(join(root, RENDER_HISTORY_FILE), 'utf8')).length, 1);});++test('placed assets and generated geometry count even though they have no node of their own', () => {+ const cubeOnly = inspection({ nodeCount: 1, trianglesEach: 12 });+ assert.equal(sceneSizeFrom(cubeOnly, recipe).triangles, 12);+ const withAsset = { ...cubeOnly, counts: { ...cubeOnly.counts, vertices: 800000 }, assets: [{ assetId: 'a'.repeat(64), parts: 40 }] };+ assert.equal(sceneSizeFrom(withAsset, recipe).triangles, 400000);+ const tenCopies = { ...withAsset, assets: Array.from({ length: 10 }, () => ({ assetId: 'a'.repeat(64), parts: 40 })) };+ assert.equal(sceneSizeFrom(tenCopies, recipe).triangles, 12 + 399988 * 10);+ const withVegetation ={ ...cubeOnly, counts: { ...cubeOnly.counts, vertices: 150000 }, vegetation: { trees: 300 } };+ assert.equal(sceneSizeFrom(withVegetation, recipe).triangles, 75000);+ const settings = settingsFor({});+ assert.ok(estimateRenderJob({ size: sceneSizeFrom(withAsset, recipe), settings, backend: 'gpu' }).seconds+ > 3 * estimateRenderJob({ size: sceneSizeFrom(cubeOnly, recipe), settings, backend: 'gpu' }).seconds);+});++test('the concise result keeps seconds, the estimate ratio and fallbacks, and drops the rest of the report', () => {+ const settings = settingsFor({ renderer: { type: 'pathTracer', backend: 'native', samples: 64 } });+ const metrics = { elapsedSeconds: 3, peakNodeBytes: 2 ** 28, peakBrowserHeap: 2 ** 26, pathTracer: { averageSamples: 64, backendNote: 'The gpu backend ran instead.' } };+ const report = renderReport({ estimate: { seconds: 2.5, peakMemoryMiB: 300, basis: 'scene size' }, settings, metrics });+ const result = { jobId: 'x', sourceRevision: 1, artifacts: [{ filename: 'render.png', sha256: 'y' }], metrics: { pathTracer: metrics.pathTracer, report } };+ const concise = conciseJobResult(result);+ assert.deepEqual(concise.metrics.report, { seconds: 3, secondsRatio: 1.2, fallbacks: ['The gpu backend ran instead.'] });+ assert.ok(JSON.stringify(concise.metrics.report).length < 120);+ const quiet = conciseJobResult({ ...result, metrics: { report: renderReport({ settings: settingsFor({}), metrics: { elapsedSeconds: 1 } }) } });+ assert.deepEqual(quiet.metrics.report, { seconds: 1 });+});++test('a job that ran at a smaller size than requested is not added to the history', () => {+ const settings = settingsFor({ width: 1920, height: 1080 });+ const estimate = { modelSeconds: 1, modelPeakMemoryMiB: 200, seconds: 1, peakMemoryMiB: 200, basis: 'scene size' };+ const reduced = renderReport({ estimate, settings, metrics: { elapsedSeconds: 1, requestedWidth: 1920, requestedHeight: 1080, width: 960, height: 540 } });+ assert.equal(reduced.frameReduced, true);+ assert.deepEqual(historyWithJob([], { settings, backend: 'gpu', estimate, report: reduced }), []);+ const normal = renderReport({ estimate, settings, metrics: { elapsedSeconds: 1, requestedWidth: 1920, requestedHeight: 1080, width: 1920, height: 1080 } });+ assert.equal(historyWithJob([], { settings, backend: 'gpu', estimate, report: normal }).length, 1);+});++test('the basis names the jobs folder, a clamped time factor and missing memory history', () => {+ const size = sceneSizeFrom(inspection({ nodeCount: 5, trianglesEach: 500 }), recipe);+ const settings = settingsFor({});+ const basis = estimateRenderJob({ size, settings, backend: 'gpu', history: [historyEntry(100), historyEntry(100)] }).basis;+ assert.match(basis, /in this jobs folder/);+ assert.match(basis, /time factor limited to 4x/);+ assert.doesNotMatch(basis, /memory from scene size only/);+ const noMemory = [{ ...historyEntry(2), measuredPeakMemoryMiB: 0 }, { ...historyEntry(2), measuredPeakMemoryMiB: 0 }];+ assert.match(estimateRenderJob({ size, settings, backend: 'gpu', history: noMemory }).basis, /memory from scene size only/);+ assert.doesNotMatch(estimateRenderJob({ size, settings, backend: 'gpu', history: [historyEntry(1.5), historyEntry(1.5)] }).basis, /\(/);+});