Monorepo for Aesthetic.Computer aesthetic.computer

oskiewar: the Mac takes a frame's faces in one crossing, not 2,700

A call from JavaScriptCore into Swift costs 1.2-2.3 us on this Mac (measured below), and a dojo fight paints ~2,700 faces one triangle3d call each. The Metal scene has had a batched entry (triangleBatch) all along; the host never bound it. The Mac now binds triangles3d(Float32Array, count?) and advertises `batchFaces`. On such a host the engine gathers triangle3d into one Float32Array and hands it over whenever anything else touches the scene lane (box, line, flat or translucent face, wipe, a direct batch) and at the end of the paint, so the lane's order is exactly the per-call order and the backdrop/overlay split (sawFace) is unchanged. The console keeps one call per face: under QuickJS a typed-array write is the dearer side (see emitTriangle). Measured: - JSC bridge bench (xbox/macos-native style blocks, swiftc -O): 2,700 faces cost 4.1-6.1 ms a frame as calls and 1.1-1.45 ms batched. - paint-bench, mac host: ~2.3 crossings a frame in a fight instead of ~2,700; the scene lane (faces, boxes, lines, alpha) hashes identical batched and per-call in fight, self-play and freeskate. - face-batch.test.mjs asserts the same, event for event. Mac app builds (npm run oskiewar:mac:build).


Author prompt.ac/@jeffrey Date Commit Parent e467bb0a
+65 -1
3 changed files
+65 -1
3 changed files