Primortal Tech

Measure the cost of a frame

Replay the same scene across builds to measure memory and rendering work on a comparable route.

Walkthrough

Phone memory in HQ

Fix the route and viewpoint

Benchmark workload
HQ idle

A stationary replay with a fixed game seed.

Phone viewport
390 × 844

Chromium software WebGL in the recorded history.

A seeded input trace keeps the benchmark repeatable. The browser starts at 390 × 844, with a fresh context for each run.

Link to this step

Compare like-for-like memory

Web replay baseline
642 MiB
Phone GC pass
463 MiB

The high-water mark is WASM linear memory. These historical samples compare the Web replay baseline with the later phone GC pass.

Link to this step

Check the game before promotion

HQ in game
HQ in game
Promotion coverage
6 workloads

The current gate checks timing and memory separately.

The native release gate replays six workloads. Full phone measurements run separately against the immutable live build. HQ is one reference scene.

Link to this step

Renderer work in HQ

Measure submitted draw calls

Web replay baseline
31 calls
Animated city crowds pass
33 calls

The counter tracks actual native GL submissions before rasterization. The recorded values compare the same HQ idle scene.

Link to this step

Read cost and look at the scene

Crowds pass CPU per frame
46.9 ms
HQ in game
HQ in game

Draws and CPU measure different things. Compare the paired timing against the rendered place before opening promotion.

Link to this step

Build notes

Replay six adventure workloads

Native CPU and allocation cost by revision on a shared replay

The current suite covers Block lobby idle, a Lab hub run, the West stair crossing, the Materials Gallery crowd, the Lab shadow chase, and Rain Plaza with dressed surfaces and atmosphere. Each starts from a fresh slot. An input script specifies the boot point, RNG seed, buttons and exact tick count. Native runs one fixed update and one draw per frame without VSync and warms the first 20 frames before sampling. The browser replays the same holds through the fixed update loop and verifies the route before reporting memory. The stair must reach its authored upper landing. The Lab run exercises the current travel-driven locomotion cadence along the same seeded route.

On Linux the replay records process CPU, including native OpenGL submission and the software driver, at a 480 x 320 window. The result includes update, background setup, underlays, dressing, depth-sorted actors and walls, foreground, batch submission, lighting, bloom, HUD, scaled composition, overlay, presentation, and synchronous adventure audio. The CPU profile stays with each run for stack attribution. Child phases are part of their parent totals. Dressing covers rail glints together with water, ground effects and the atmosphere pass. The HUD phase includes the training lesson goal strip, which re-evaluates its goal list every ten updates rather than every frame. A play link or checkpoint can enable a temporary tile grid in this pass. The six benchmark routes run with the default grid setting, which skips those draw calls. Process CPU can include audio, GC and driver activity concurrent with a measured phase. The per-update audio line covers calls made on the game thread. The Go profile can attribute samples on the mixer separately.

Track memory across cold loads

Go heap, linear memory and collection changes at selected revisions

The browser starts each route in a fresh 390 x 844 phone context. Its WASM linear memory grows in pages and supplies a high-water mark for the whole run. Go heap samples, allocations, and collection counts describe memory inside that address space. Browser JavaScript, decoded Web Audio, and graphics allocations also contribute to the tab footprint. The texture and audio probes report these separately. Collections per second use 60 simulation ticks as the denominator.

Play review context keeps a bounded ten-second window of already recorded inputs and gameplay events. The player reads poses and visible entities only when feedback is composed or a frame is requested. Saving without a screenshot does no framebuffer readback.

A cinematic loads the PNGs for its active card. A continuous reveal draws its prepared destination in place and activates the same map state on handoff. The opening prepares the bedroom during the printed footer hold and draws it when the wall print comes through. The creator and its fade have already left the screen by the time the map allocates its render state. Atlas packing paints each page into one buffer that the build reuses, flips it for upload a row at a time and uploads it at once. On the web build a page then keeps only a one-bit ink mask, 512 KiB for a 2048 × 2048 page, instead of 16 MiB of RGBA.

The six paired native and browser routes use direct adventure starts. Two browser-only fixtures cover the cold creator through the first bedroom step and the first lift ride through the Floor 13 reveal to Ground. They require their actual destinations before reporting a sample. The wake fixture includes the title and creator assets and has a 430 MiB cap. The lift and the six paired routes use 410 MiB. The wake replay presses A 201 ticks later to cover the revised print fade, pan and footer hold. It still checks a first bedroom step.

Count work before promotion

Submitted OpenGL draw calls and vertices at selected revisions

The native OpenGL probe counts submitted draw calls and vertices. Vertices describe geometry sent to the driver. One sprite quad normally contributes six, and a full-screen pass or a shape can contribute too. Fragments shaded and presentation time require separate measurement. The browser records equivalent WebGL submissions for comparison. The Gallery monorail uses a repeated pylon sprite, a narrow guideway cross-section and a single train frame. The pylons and guideway share an item in the reused depth list. The train reuses one mutable atlas view at the tunnel mouths, and its shadow uses a ground quad. The crowd replay retains the same actor count and route.

scripts/perf bench measures both targets and writes JSON. Release runs scripts/perf check --native-only for CPU, allocations, allocated bytes and draw submissions. Native CPU uses the median of three fresh runs. The game-thread ceiling excludes the software rasterizer and GC workers. Total process CPU and spread stay in the report for diagnosis. Native runs share the renderer pool and honor release slot 2. When an additional worker slot is idle, release goldens can run in two isolated shards.

Release smoke uses iPhone-sized WebKit to boot the exact staged player on the default and one affected route under the hard 480 MiB cap. The hourly and uncached nightly phone jobs test the immutable live build. Both engines enforce the memory, transfer and readback ceilings. Each scripted route uses the largest WASM measurement across three fresh contexts per engine. Legacy route updates above 8 ms p95 are logged. Street input waits for neutral controls and steps toward the kerb before checking the eastbound landing. An on-demand subset uses the same phone probe. Passing phone routes can carry forward when the exact build, probe, browser and sampling settings match.

Puzzle builder

Puzzle builder loads the adventure player once in an iframe and keeps it warm across attempts. Reset swaps in a new map and an in-memory save. The preview skips campaign autosave and session recording, so an iteration does not add a campaign save or a playtest upload. Puzzle builder workflow

The Puzzle loader WebKit gate loads each shipped library example and exercises diagnosed failures against the staged player. After the release suite passes, the release service publishes the Studio editor and library pinned to that live player. The same step redeploys Draw the T when its sources or the installed T cuts change. The release budgets and replay workload use the same staged build.

The phone WebKit report gate checks document loading, offline reads and retries before promotion. The same gate checks the Review outbox: a note the server already holds is marked sent, and a refused note can be read, retried to the current round or discarded. It uses a small staged snapshot and shares the devbox render slots with the game benchmarks.

Smash recovery uses the normal movement reservation and camera with a longer authored clock for the north half-step. The Ionizer and drained weed use the existing character and obstacle draws. Each affected weed cell switches cels after its small propagation delay on the same fixed game tick. No extra render target is allocated.

Stacked room collision caches authored surfaces by column. The renderer culls projected pieces against the viewport before sorting by row, elevation and support. Its camera bounds use projected world height. A tall authoring level does not add rows to the Tiled collision grid or increase the scene render-target dimensions.

Blockout tiles and short-hop poses use a small atlas created on first entry to a stacked room. The depth pass batches consecutive draws from the same atlas to preserve the order between geometry and actors.

Limits

The draw probe sees submissions to OpenGL and WebGL. Fill cost depends on screen coverage, overlap, shader complexity and the GPU. The physical iPhone's thermal state and the reasons its operating system reclaims pages remain unmeasured.

The score decodes one selected scene cue at a time and retires the outgoing voice after its fade. Web Audio keeps the 2.5-second encounter cue ready at source rate, about 215 KiB of PCM. Its existing samples loop quietly under the drum fill and fade at the start of the battle score. It opens one short outcome print only when that result fires. A brief pursuit hold avoids redecodes when a shadow loses sight at a corner. The phone download excludes the superseded training loop and the older score stems.

The phone jobs store passing routes by the exact build, probe inputs, sampling settings and browser version. A retry can reuse an identical passing route. Native release checks still run against the staged revision. The phone history records each browser separately and includes any time spent waiting for the shared render pool. The promotion command runs from the service-owned checkout of merged dev. It replaces the old focused player entry pages with small redirects after verifying the game artifacts. Those redirects load no WASM. After the release checks pass, the service publishes any changed Review shell and advertises the game and shell together. Deferred retests wait for that publication.

The cinematic compositor uploads a single 240 by 160 plane while a scene plays. Indexed PNGs travel in the world bundle. At each card entrance, the decoder expands the active images to straight RGBA once, so opacity and scale can sample bytes directly on every frame. The decoded pixels leave the live heap when the card is replaced. The compositor skips an unchanged plane and the web upload keeps one 150 KiB staging array for the native raster. A same-map return can reuse the paused room at its existing contact or move the recruit to a named waypoint before control comes back. Selected appearance crops open only on the page that uses them.

A cold route retries once if its page closes while the browser remains connected. Budget overages still fail the gate.

Smash and Cut reuse the actor and obstacle atlas draws. Crown shake offsets the existing world matrix, and the beam, dust and leaves are pixels in those two draws. The fixed performance routes do not time a tool contact.