Advance M8-M11 parity workflows
This commit is contained in:
@@ -35,16 +35,26 @@ test("meets the Chromium OPFS Simulation cache playback performance gate", async
|
||||
})));
|
||||
const sourceBlend = Uint8Array.from([0x42, 0x4c, 0x45, 0x4e, 0x44, 0x45, 0x52]).buffer;
|
||||
const fixedHash = await digest(Uint8Array.from([1, 2, 3]).buffer);
|
||||
const manifest = {
|
||||
schemaVersion: 1 as const,
|
||||
const binding = {
|
||||
graphId: "geometry-node-tree:simulation-performance",
|
||||
graphHash: fixedHash,
|
||||
sourceBlendSha256: await digest(sourceBlend),
|
||||
sourceRevision: 1,
|
||||
inputHash: await digest(Uint8Array.from([4, 5, 6]).buffer),
|
||||
cacheSha256: await digest(payload),
|
||||
blenderVersion: "5.2.0",
|
||||
frameStart: 1,
|
||||
frameEnd: frameCount,
|
||||
};
|
||||
const revisionHash = await digest(new TextEncoder().encode(JSON.stringify([
|
||||
"blender-web-simulation-cache-revision-v2", binding.graphId, binding.graphHash,
|
||||
binding.sourceBlendSha256, String(binding.sourceRevision), binding.inputHash,
|
||||
binding.blenderVersion, String(binding.frameStart), String(binding.frameEnd),
|
||||
])).buffer);
|
||||
const manifest = {
|
||||
schemaVersion: 2 as const,
|
||||
...binding,
|
||||
revisionHash,
|
||||
cacheSha256: await digest(payload),
|
||||
byteLength: payload.byteLength,
|
||||
frames,
|
||||
};
|
||||
@@ -58,6 +68,7 @@ test("meets the Chromium OPFS Simulation cache playback performance gate", async
|
||||
const storedAt = performance.now();
|
||||
|
||||
const reader = new StorageClient();
|
||||
await reader.prepareSimulationCachePlayback(projectId, stored.cacheKey);
|
||||
const identity = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
||||
const scene = {
|
||||
schemaVersion: 1 as const,
|
||||
@@ -77,7 +88,7 @@ test("meets the Chromium OPFS Simulation cache playback performance gate", async
|
||||
frameEnd: frameCount,
|
||||
readFrame: async (frame, signal) => {
|
||||
if (signal.aborted) throw new DOMException("Playback aborted", "AbortError");
|
||||
const read = await reader.readSimulationCacheFrame(projectId, stored.cacheKey, frame);
|
||||
const read = await reader.readSimulationCacheFrame(projectId, stored.cacheKey, frame, signal);
|
||||
if (signal.aborted) throw new DOMException("Playback aborted", "AbortError");
|
||||
return read.data;
|
||||
},
|
||||
@@ -86,10 +97,12 @@ test("meets the Chromium OPFS Simulation cache playback performance gate", async
|
||||
lastTranslation = preview.nodes[0].transform.translation[0];
|
||||
});
|
||||
const playbackResult = await playback.play();
|
||||
await reader.releaseSimulationCachePlayback(projectId, stored.cacheKey);
|
||||
const finished = performance.now();
|
||||
reader.terminate();
|
||||
const readerPendingAfterTerminate = reader.getPendingRequestCount();
|
||||
const recovery = new StorageClient();
|
||||
await recovery.prepareSimulationCachePlayback(projectId, stored.cacheKey);
|
||||
const recovered = await recovery.readSimulationCacheFrame(projectId, stored.cacheKey, frameCount);
|
||||
recovery.terminate();
|
||||
const recoveryPendingAfterTerminate = recovery.getPendingRequestCount();
|
||||
|
||||
Reference in New Issue
Block a user