Skip to content

VANILLAJS v3.4.0 β€” THE ALLOCATION OBSERVATORY πŸ‘½πŸ”¬βš™οΈ

Choose a tag to compare

@EmergentMonk EmergentMonk released this 22 Nov 17:27
Immutable release. Only release title and notes can be modified.
0cffbcf

GC-PROFILE-001 β€” Measure the Machine Before Optimizing It

You cannot optimize what you haven't measured.

VANILLAJS v3.4.0 introduces THE ALLOCATION OBSERVATORY, a reproducible profiling system for investigating JavaScript memory allocation, garbage-collection activity and rendering performance during actual browser gameplay.

Following v3.3.0 β€” THE MEMORY FORGE, which introduced reusable low-allocation geometry buffers, this release provides the evidence infrastructure needed to measure their behaviour.

Rather than making unverified performance claims, VANILLAJS can now collect source-bound observations of memory allocation, GC events, frame intervals and JavaScript execution costs.

Build. Measure. Verify. Optimize.


What's new

GC-PROFILE-001 β€” The Allocation Observatory

A new experimental profiling system measures browser memory behaviour without modifying the underlying game engine or JavaScript garbage collector.

The Observatory combines:

  • Chrome DevTools Protocol allocation sampling.
  • Garbage-collection event tracing.
  • JavaScript heap occupancy measurements.
  • Frame-time and CPU-work instrumentation.
  • Reproducible WebGL rendering workloads.
  • Exact source and environment identification.
  • SHA-256-sealed evidence reports.

The profiler remains separate from the distributed game runtime and introduces no new runtime dependencies.

Real FPS gameplay profiling

The Observatory can profile the existing Block Arena Foundry during actual gameplay.

The test executes the regular game rather than substituting simulated benchmark behaviour.

It exercises:

  • CPU-controlled opponents.
  • Authoritative combat and movement.
  • Character and projectile systems.
  • Navigation and collision.
  • WebGL rendering.
  • Live HUD updates.
  • Keyboard movement and firing.

The resulting evidence helps identify allocation-heavy operations that occur during a real game.

Dynamic geometry stress testing

The new visual workload compares two rendering-data preparation approaches:

  1. Legacy geometry assembly: Traditional JavaScript arrays converted into Float32 vertex data.
  2. Reusable geometry streams: The BoxVertexStream system introduced in VANILLAJS v3.3.0.

Four workload sizes are supported:

Workload Visual boxes Triangles
P1 64 768
P2 128 1,536
P3 256 3,072
P4 512 6,144

Each workload uses the actual WebGL1 renderer and validates exact Float32 geometry parity before measurement.

These are visual objects, not additional authoritative Combat3D projectiles.

First executed performance observations

The hosted Chromium evidence workflow completed 17 independent observations:

  • One real Block Arena FPS gameplay session.
  • Sixteen paired visual-geometry measurements.
  • Two measurement passes with reversed execution order.
  • Raw frame and allocation evidence preserved for independent inspection.

Example: 512-box workload

Measurement Legacy assembly Reusable stream
Sampled allocation, pass 1 667.5 MB 1.33 MB
Observed outer GC events, pass 1 61 1
p95 JavaScript work, pass 1 5.3 ms 0.3 ms
Sampled allocation, pass 2 671.7 MB 1.49 MB
Observed outer GC events, pass 2 61 1
p95 JavaScript work, pass 2 3.8 ms 0.3 ms

The observations show substantially lower allocation sampling and fewer recorded GC events for the reusable geometry stream under this particular workload.

These are instrumented, hosted software-rendering observationsβ€”not measured improvements to complete game FPS.

The p95 rendering intervals remained approximately 16.7–16.8 ms across both implementations. Statistical allocation samples are not exact cumulative allocation totals, and recorded GC events do not establish complete stop-the-world pause accounting.

Physical GPU performance and broader browser comparisons remain separate research tasks.

Garbage-collection trace correctness

During development, the profiler identified overlapping records in Chrome's tracing output.

Chrome can report a high-level garbage-collection event alongside nested V8 internal phases.

The final implementation avoids treating those nested records as separate complete collections.

The analysis prefers outer MinorGC and MajorGC records and uses documented fallbacks when necessary.

This improves the interpretability of the recorded evidence without claiming that every garbage-collection event is observable.

New development tools

Browser profiling

node scripts/gc-profile-browser.mjs \
  --out /tmp/gc-profile-001 \
  --frames 60 \
  --warmup 20 \
  --backend software

The browser profiler requires an externally provided Playwright/Chromium testing installation.

It is not a dependency of games built using VANILLAJS.

Numerical and analysis verification

node --test tests/gc-profile.test.js
node --test tests/*.test.js
node scripts/check.js
node scripts/build.js
node scripts/verify-offline.js

The Observatory includes tests for:

  • Correct p50, p95 and p99 calculations.
  • Valid allocation sample attribution.
  • Garbage-collection event classification.
  • Detection of nested GC records.
  • Malformed and non-finite observation rejection.
  • Explicit workload-capacity limits.
  • Separation of heap occupancy from allocation sampling.

Evidence preservation

Each completed profiling run records:

  • Exact Git commit identity.
  • Browser and runtime versions.
  • Operating environment and graphics backend.
  • Workload configuration.
  • Raw frame intervals and JavaScript timings.
  • Allocation sampling observations.
  • GC event observations.
  • Heap occupancy measurements.
  • Screenshots and workload metadata.
  • SHA-256 evidence receipts.

The results can be inspected independently rather than relying on an unsupported performance headline.

Verified hosted evidence:

GC-PROFILE-001 β€” Successful Chromium workflow

Recorded evidence SHA-256:

5b947830e1c3e64d860242faff6bcee931aea8cfdbd3dca416e50d1980a1b638

Compatibility and architecture

VANILLAJS v3.4.0 preserves the existing game-engine contracts.

  • No changes to authoritative simulation.
  • No changes to collision or damage.
  • No changes to published replay formats.
  • No changes to the existing renderer API.
  • No replacement of the browser garbage collector.
  • No increase to Combat3D projectile capacity.
  • No new third-party game-engine dependencies.
  • No mandatory runtime profiling overhead.

The Allocation Observatory is an opt-in development tool.

Existing games continue using their established engine versions until their integrations are independently reviewed.

Verification status

All 20 post-merge GitHub Actions workflows passed.

The merged implementation includes:

  • scripts/gc-profile-browser.mjs
  • scripts/gc-profile-core.mjs
  • tests/gc-profile.test.js
  • docs/GC_PROFILE_001.md
  • .github/workflows/gc-profile-001.yml
  • Updated developer guidance and documentation auditing.

The existing source and packaging verification gates remain intact.

What's next β€” VANILLAJS v3.5.0 candidates

With rendering allocation measurement now available, future improvements can be selected using actual evidence.

Potential next phases include:

GC-POOL-001 β€” Bounded Object Pooling

Investigate reusable storage for visual effects, projectiles and temporary render objects without changing authoritative gameplay behaviour.

GC-SNAPSHOT-001 β€” Simulation Memory Audit

Profile snapshot creation and state-copying overhead while preserving deterministic replay and data ownership.

GC-GEOMETRY-002 β€” Dynamic Geometry Optimisation

Investigate improved batching and memory reuse for increasingly dense scenes.

GC-NATIVE-001 β€” Physical GPU Verification

Compare headless software-rendering results against native graphics hardware with independent frame, allocation and GPU measurements.

These phases are proposals, not features included in v3.4.0.

Future game integration

The Observatory provides an engineering foundation for future versions of:

  • BOOMER-SHOOTER, including the proposed STORM PROTOCOL bullet-hell mode.
  • Vehicular-Warfare, including mechs, tanks, aircraft and ships.
  • Games2 and other QSOL-IMC titles using VANILLAJS.

Optimizations will be adopted only after preserving their respective simulation, collision and replay contracts.


Release provenance

Repository: https://github.com/QSOLKCB/VANILLAJS

Version: v3.4.0 β€” THE ALLOCATION OBSERVATORY

Previous release: v3.3.0 β€” THE MEMORY FORGE

Development milestone: GC-PROFILE-001

Merged pull request: #152

Verified release candidate commit:

0cffbcfe2524bbf7f82190ef8ef0813aeb6bb466

Full changes:

v3.3.0...0cffbcf

Post-merge CI: 20/20 workflows successful

Licence: Apache-2.0


QSOL-IMC β€” THIS IS NOT A PRODUCT. THIS IS INDEPENDENCE.

VANILLAJS v3.4.0 β€” THE ALLOCATION OBSERVATORY πŸ‘½πŸ”¬

The engine no longer has to guess where the garbage goes.

Measure the machine. Preserve the evidence. Let correctness decide.