Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
686b6f1
Add BH #2D hardware scaling sweep harness
EmergentMonk Sep 27, 2026
ff1ab08
Test BH #2D hardware sweep receipt gates
EmergentMonk Sep 27, 2026
73b9c8c
Document BH #2D hardware sweep evidence
EmergentMonk Sep 27, 2026
131f62d
Add BH #2D hardware evidence protocol to roadmap
EmergentMonk Sep 27, 2026
761dd6c
Document BH #2D hardware sweep runner
EmergentMonk Sep 27, 2026
14b999a
Validate BH #2D hardware sweep host contract in CI
EmergentMonk Sep 27, 2026
ff6b039
Preserve failed BH #2D sweep manifests
EmergentMonk Sep 27, 2026
20af0f0
Trigger native GPU CI for BH #2D sweep changes
EmergentMonk Sep 27, 2026
d142ca8
Document BH #2D hardware sweep in README
EmergentMonk Sep 27, 2026
3d35cfd
Harden BH #2D hardware evidence validation
EmergentMonk Sep 27, 2026
2570e34
Cover BH #2D evidence integrity regressions
EmergentMonk Sep 27, 2026
88f8b9c
Tighten BH #2D evidence provenance and receipt binding
EmergentMonk Sep 27, 2026
a8d444c
Cover latest BH #2D evidence integrity findings
EmergentMonk Sep 27, 2026
89a898d
Harden BH #2D toolchain and topology provenance
EmergentMonk Sep 27, 2026
1243fc5
Recheck toolchain before completing BH #2D sweep
EmergentMonk Sep 27, 2026
d00d223
Cover toolchain, index and topology evidence regressions
EmergentMonk Sep 27, 2026
b317f18
Isolate BH #2D builds and reject Cargo execution redirects
EmergentMonk Sep 27, 2026
e9f0145
Cover fresh build, Cargo redirect and leaf-bound regressions
EmergentMonk Sep 27, 2026
a4c5472
Harden hardware sweep launch, toolchain provenance and failure records
EmergentMonk Sep 27, 2026
9755fd8
Make lightweight self-gravitating N-body observatory the home page
EmergentMonk Sep 27, 2026
67fae35
Harden BH2D hardware evidence provenance
EmergentMonk Sep 27, 2026
f7e0e08
Cover BH2D provenance and topology review cases
EmergentMonk Sep 27, 2026
95b051f
Correct browser entrypoint licence attribution
EmergentMonk Sep 27, 2026
053efca
Harden BH2D Git and build provenance checks
EmergentMonk Sep 27, 2026
bf1b411
Preserve fixed-rate 4x N-body scheduling
EmergentMonk Sep 27, 2026
1a774f5
Cover BH2D provenance edge cases
EmergentMonk Sep 27, 2026
e4105e7
Test 4x N-body refresh-rate invariance
EmergentMonk Sep 27, 2026
f24b5fd
Keep dry-run path regression toolchain-neutral
EmergentMonk Sep 27, 2026
5a7a0dc
Validate BH2D leaf capacity evidence
EmergentMonk Sep 27, 2026
3c4339f
Cover BH2D undersized leaf evidence
EmergentMonk Sep 27, 2026
ad3a8e7
Document bounded N-body catch-up accurately
EmergentMonk Sep 27, 2026
e3236ed
Fix BH2D synthetic receipt fixture
EmergentMonk Sep 27, 2026
035f072
Tighten BH2D evidence consistency checks
EmergentMonk Sep 27, 2026
bc981e2
Cover BH2D fanout and force consistency
EmergentMonk Sep 27, 2026
52d7431
Count N-body root in level readout
EmergentMonk Sep 27, 2026
fb132ad
Test N-body level readout
EmergentMonk Sep 27, 2026
0413c4f
Keep topology negative tests independent
EmergentMonk Sep 27, 2026
9178a6d
Harden BH2D adapter and subprocess evidence checks
EmergentMonk Sep 27, 2026
6ca1066
Cover BH2D adapter and evidence edge cases
EmergentMonk Sep 27, 2026
6f396bc
Reset N-body FPS accounting on visibility changes
EmergentMonk Sep 27, 2026
8ebc548
Test FPS reset after hidden tabs
EmergentMonk Sep 27, 2026
5126025
Model visibility timing without extra physics step
EmergentMonk Sep 27, 2026
53c30e4
Exercise loader environment sanitization
EmergentMonk Sep 27, 2026
ae8d6d3
Keep synthetic force summaries mathematically valid
EmergentMonk Sep 27, 2026
6da5fc3
Reject contradictory BH2D state-error summaries
EmergentMonk Sep 27, 2026
00de9c9
Cover contradictory state-error summaries
EmergentMonk Sep 27, 2026
b8ccf44
Harden BH2D Vulkan and topology provenance
EmergentMonk Sep 27, 2026
4f1ba55
Cover Vulkan, adapter, and occupancy edge cases
EmergentMonk Sep 27, 2026
fd624a3
Point engine guide at rotation instrument
EmergentMonk Sep 27, 2026
8730131
Harden BH2D receipt and Vulkan validation
EmergentMonk Sep 27, 2026
89b5e3f
Cover additive Vulkan and strict receipt parsing
EmergentMonk Sep 27, 2026
a9cd8cc
Bound BH2D internal cells by bucket occupancy
EmergentMonk Sep 27, 2026
75be300
Cover bucket-bounded BH2D occupancy
EmergentMonk Sep 27, 2026
f78d733
Clarify GALAXY browser entrypoints
EmergentMonk Sep 27, 2026
6f61b90
Harden BH2D loader and failed-run evidence
EmergentMonk Sep 27, 2026
1e8a34a
Cover loader controls and failed-run log binding
EmergentMonk Sep 27, 2026
af0339c
Bind all unusable BH2D runs and harden Darwin env
EmergentMonk Sep 27, 2026
f6822b5
Cover Darwin env and unusable successful runs
EmergentMonk Sep 27, 2026
c95db12
Harden BH2D parser and topology invariants
EmergentMonk Sep 27, 2026
049152d
Cover BH2D selector, topology, hash, and JSON edge cases
EmergentMonk Sep 27, 2026
df4ffcc
Bind GPU adapter enumeration count
EmergentMonk Sep 27, 2026
2ad1c95
Tighten BH2D adapter and dependency provenance
EmergentMonk Sep 27, 2026
cb46356
Cover adapter fallback and in-repo dependency provenance
EmergentMonk Sep 27, 2026
89b5080
Add clean launch and platform tool policy
EmergentMonk Sep 27, 2026
1ead951
Add clean POSIX BH2D launcher
EmergentMonk Sep 27, 2026
806b9dc
Add native Windows BH2D launcher
EmergentMonk Sep 27, 2026
a4f39d6
Record clean launcher and platform tools
EmergentMonk Sep 27, 2026
ccbb75e
Default launcher Rust homes safely
EmergentMonk Sep 27, 2026
3970054
Test clean launch and platform tool policies
EmergentMonk Sep 27, 2026
82109d5
Exercise clean BH2D launcher in CI
EmergentMonk Sep 27, 2026
413a405
Document clean BH2D launch boundary
EmergentMonk Sep 27, 2026
1c2e59a
Use clean BH2D launcher in README
EmergentMonk Sep 27, 2026
816e31a
Document Windows BH2D tool policy
EmergentMonk Sep 27, 2026
31568ae
Keep Windows trusted base system-only
EmergentMonk Sep 27, 2026
c313e9c
Align Windows trusted-path regression
EmergentMonk Sep 27, 2026
682369c
Fix platform-policy test fixtures
EmergentMonk Sep 27, 2026
657d45b
Propagate Windows BH2D launcher failures
EmergentMonk Sep 27, 2026
787820d
Route GPU guide through clean BH2D launcher
EmergentMonk Sep 27, 2026
4a9ec4a
Validate frozen BH2D tree declarations
EmergentMonk Sep 27, 2026
5aba347
Cover frozen BH2D tree declarations
EmergentMonk Sep 27, 2026
4ae0f05
Test Windows BH2D launcher exit status
EmergentMonk Sep 27, 2026
da9bf28
Make Windows launcher regression self-checking
EmergentMonk Sep 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
- name: Check Barnes-Hut self-gravity reference
run: |
node tests/barnes-hut.mjs
node tests/nbody-view.mjs
cargo test --manifest-path nbody/Cargo.toml --locked --offline
cargo run --manifest-path nbody/Cargo.toml --locked --offline -- verify
cargo run --manifest-path nbody/Cargo.toml --locked --offline -- verify-flat
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/native-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Native GPU runtime
on:
push:
branches: [main]
paths: ['runtime/**', 'rust/**', 'nbody/**', 'data/uff/**', 'tests/uff-reference.json', 'scripts/*gpu*', 'scripts/vast-runner.py', 'rust-toolchain.toml', '.github/workflows/native-gpu.yml', '.dockerignore', 'LICENSE', 'NOTICE.md']
paths: ['runtime/**', 'rust/**', 'nbody/**', 'data/uff/**', 'tests/uff-reference.json', 'tests/test_bh2d_hardware_sweep.py', 'scripts/*gpu*', 'scripts/bench-bh2d-hardware.py', 'scripts/bench-bh2d-hardware-launch.sh', 'scripts/bench-bh2d-hardware-launch.cmd', 'scripts/vast-runner.py', 'rust-toolchain.toml', '.github/workflows/native-gpu.yml', '.dockerignore', 'LICENSE', 'NOTICE.md']
pull_request:
paths: ['runtime/**', 'rust/**', 'nbody/**', 'data/uff/**', 'tests/uff-reference.json', 'scripts/*gpu*', 'scripts/vast-runner.py', 'rust-toolchain.toml', '.github/workflows/native-gpu.yml', '.dockerignore', 'LICENSE', 'NOTICE.md']
paths: ['runtime/**', 'rust/**', 'nbody/**', 'data/uff/**', 'tests/uff-reference.json', 'tests/test_bh2d_hardware_sweep.py', 'scripts/*gpu*', 'scripts/bench-bh2d-hardware.py', 'scripts/bench-bh2d-hardware-launch.sh', 'scripts/bench-bh2d-hardware-launch.cmd', 'scripts/vast-runner.py', 'rust-toolchain.toml', '.github/workflows/native-gpu.yml', '.dockerignore', 'LICENSE', 'NOTICE.md']
workflow_dispatch:

permissions:
Expand All @@ -25,6 +25,12 @@ jobs:
python-version: '3.12'
- name: Check SSH runner and result extraction on Windows
run: python runtime/tests/test_runner.py
- name: Check BH2D Windows launcher propagates Python failure
shell: cmd
run: |
call scripts\bench-bh2d-hardware-launch.cmd --particles 512 --dry-run
if %ERRORLEVEL% EQU 0 exit /b 1
exit /b 0

runner-python:
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -60,6 +66,8 @@ jobs:
bash -n scripts/run-gpu.sh scripts/bootstrap-gpu.sh
python runtime/tests/test_runner.py
python runtime/cuda/check_barnes_hut_layout.py
python tests/test_bh2d_hardware_sweep.py
sh scripts/bench-bh2d-hardware-launch.sh --dry-run --output "$RUNNER_TEMP/bh2d-plan" --particles 512,4096,8192
- name: Install software Vulkan for compute validation
run: |
sudo apt-get update -qq
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
node tests/physics.mjs
node tests/app.mjs
node tests/barnes-hut.mjs
node tests/nbody-view.mjs
cargo test --manifest-path nbody/Cargo.toml --locked --offline
cargo run --manifest-path nbody/Cargo.toml --locked --offline -- verify
node scripts/build-site.mjs
Expand Down
9 changes: 5 additions & 4 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ and local PNG/WebM/JSON capture. Galaxy orbital equations and the accelerated
renderer replace the original gate–centre–mouth transfer geometry.

The adapted browser sources (`galaxy-core.js`, `app.js`, `renderer.js`,
`index.html`, `style.css`, and the JavaScript smoke/application tests) retain
`rotation-lab.html`, `style.css`, and the JavaScript smoke/application tests) retain
**Mozilla Public License 2.0** file notices. The full licence is in
[`LICENSES/MPL-2.0.txt`](LICENSES/MPL-2.0.txt). Their corresponding source is
provided directly in this repository and static distribution.

The new Rust sampler and native example, build scripts, generated Wasm module
and browser payload, and benchmark are
**Apache-2.0**, under the repository's existing [`LICENSE`](LICENSE).
The new N-body browser entrypoint (`index.html`, `nbody-clock.js`, and
`nbody-viz.js`), Rust sampler and native example, build scripts, generated Wasm
module and browser payload, and benchmark are **Apache-2.0**, under the
repository's existing [`LICENSE`](LICENSE).
The existing repository licence has not been used to relicense the MPL files.

VORTEX's reference photographs, artwork and historical stress-test reports are
Expand Down
33 changes: 26 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@

It began as an adaptation of the VORTEX 2.1.0 particle lab and now combines:

- interactive rotation-curve visualization;
- a lightweight default N-body simulator: 768 real interacting bodies, luminous sprites and short orbital trails;
- interactive rotation-curve visualization in the preserved rotation-law instrument;
- UFF, Newtonian, NFW, Burkert, MOND/RAR, and authored visual rotation laws;
- deterministic Rust/WebAssembly sampling in the browser;
- native Rust CPU execution with Float/libm and BAM32/Q2.30 LUT backends;
- Vulkan/`wgpu` and NVIDIA CUDA compute paths;
- memory-bounded exact-u64 logical addressing;
- reproducible benchmark receipts, topology evidence, and archived scaling studies;
- an opt-in Barnes–Hut resident self-gravity laboratory with a direct-force oracle and live quadtree visualization;
- a Barnes–Hut resident self-gravity laboratory with a direct-force oracle and live quadtree visualization;
- a GPU-oriented BH #2A Morton/Z-order + flat-cell CPU substrate with repeatable topology receipts;
- a BH #2B1 explicit f32/u32 transfer ABI with executable Vulkan/WGSL flat-tree traversal and matched CUDA traversal source;
- BH #2B2 multi-step resident self-gravity with persistent GPU state, GPU kick/drift/final-kick kernels, and an explicit CPU tree-rebuild boundary;
Expand All @@ -37,9 +38,10 @@ The v0.4.0 native-CPU evidence baseline remains archived at Zenodo as:

| Layer | Current state |
| --- | --- |
| Browser instrument | Offline HTML/CSS/JS + bundled Rust/Wasm; no server or CDN required |
| Browser logical population | Up to `2^32 = 4,294,967,296` logical stars on the Rust/Wasm path |
| Browser rendered sample | Up to 65,536 stars per frame on Rust/Wasm + WebGL |
| Browser N-body home page | 128–2,048 interacting bodies (768 default); planar Barnes–Hut gravity, leapfrog integration, glow/trails and orbit/zoom controls |
| Rotation-law instrument | Preserved at `rotation-lab.html`; offline HTML/CSS/JS + bundled Rust/Wasm |
| Rotation-law logical population | Up to `2^32 = 4,294,967,296` logical stars on the Rust/Wasm path |
| Rotation-law rendered sample | Up to 65,536 stars per frame on Rust/Wasm + WebGL |
| Native CPU runtime | Exact positive-u64 logical population, bounded resident sample up to 16,777,216 particles |
| CPU projection backends | `float-libm` and `bam-lut-q30` |
| Native GPU runtime | Rust/`wgpu`/Vulkan plus NVIDIA CUDA/CuPy RawKernel |
Expand All @@ -61,9 +63,13 @@ The earlier v0.4.0 archive remains the **before-state** for the CPU architecture

## 1. Browser instrument

Open **`index.html`** directly in a modern browser. No install, local server, CDN, or network connection is required, including for the bundled Rust/WebAssembly engine.
Open **`index.html`** directly in a modern browser for the N-body simulator. No install, local server, CDN, or network connection is required. The default 768 bodies all contribute mass; reducing the resident count reduces computation. Glow sprites and ten-step trails add visual density without adding simulated particles. The camera tilts a planar physical system; it is not a 3D force solver.

The separate **`barnes-hut.html`** entrypoint is an opt-in resident self-gravity lab with a live quadtree overlay and direct-force error probes. It does not change the default rotation-law instrument.
Choose a binary encounter, rotating disc or cold collapse. Pause, single-step, change the seed, inspect the tree, or pause for a direct-force audit. Physics uses a fixed time step on a 60 Hz schedule, independent of monitor refresh rate. Overload drops catch-up work rather than enlarging the time step or changing the body count. Reduced-motion preference starts paused and disables trails.

The original prescribed-field instrument, including its Rust/WebAssembly sampling, UFF controls and exports, is preserved at **`rotation-lab.html`**. The detailed tree laboratory remains at **`barnes-hut.html`**. The following logical-population and sampling controls describe the rotation-law instrument.
Comment thread
EmergentMonk marked this conversation as resolved.

The separate **`barnes-hut.html`** entrypoint is an opt-in resident self-gravity lab with a live quadtree overlay and direct-force error probes. The default browser entrypoint is the N-body simulator at **`index.html`**, while the preserved rotation-law instrument remains at **`rotation-lab.html`**.

The browser instrument lets you change morphology, mass model, viewing geometry, and time while watching the galaxy and its rotation curve respond together.

Expand Down Expand Up @@ -272,6 +278,16 @@ BH #2D is the active optimization path. It retains BH #2C and BH #2B2 as executa

BH #2D correctness is exercised through software Vulkan in CI, but **software-Vulkan timings are not hardware performance evidence**. A hardware speed claim requires a non-software adapter receipt.

The remaining BH #2D evidence item has a fail-closed real-GPU sweep runner:

```bash
sh scripts/bench-bh2d-hardware-launch.sh \
--output runs/bh2d-hardware-sweep \
--adapter 0
```

It runs a source-pinned 512→65,536 resident-body sweep by default, requires hardware receipts, validates the frozen correctness/oracle gates, and hashes each receipt/log into a scaling manifest. The manifest is evidence for that exact source/workload/adapter, not an automatic production-promotion claim.

`--allow-software` enables verification through software Vulkan and must not be interpreted as hardware GPU performance evidence.

The CUDA checker freezes ABI/source parity without claiming CUDA execution where no NVIDIA CUDA run occurred.
Expand Down Expand Up @@ -467,6 +483,9 @@ sh scripts/test-cpu-runtime.sh
# Retro CPU portability
sh scripts/test-retro-cpu.sh

# GPU evidence-runner host-side tests
python3 tests/test_bh2d_hardware_sweep.py

# CUDA host-side tests
python3 tests/test_cuda_u64.py
```
Expand Down
6 changes: 6 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ Stable radix ordering starts from resident-body order and preserves that order f

The initial CI fixture proves correctness through Mesa Vulkan but does not establish a hardware speedup. Real GPU performance evidence remains an explicit BH #2D completion item.

The repository now includes `scripts/bench-bh2d-hardware.py` to capture that evidence without weakening the boundary. The runner requires a clean tracked source tree and `--require-hardware`, validates the BH #2D correctness/determinism gates at every point, preserves repeat-matched BH #2C comparison through 4,096 bodies, and emits a source-pinned scaling manifest with receipt/log hashes. The harness is implementation support; BH #2D remains evidence-pending until a real-GPU manifest exists.

## BH #2E — Hardware Promotion and Scaling

After BH #2D obtains real-hardware receipts, the next promotion rung is:
Expand Down Expand Up @@ -397,3 +399,7 @@ All of the following remain useful research directions, but they are explicitly
These items were deferred while PE #15 was active. v0.6.0 closed that phase; any future work now requires an explicit phase with its own evidence boundary.

The previous detailed designs are preserved by the immutable `v0.5.0` source archive and tag; they are not discarded, only postponed.

## Browser N-body observatory

The home page now runs the existing planar Barnes–Hut solver with a modest 768-body default, selectable 128–2,048 bodies, fixed-rate integration, glow/trails and camera controls. The original prescribed-field visual is preserved at `rotation-lab.html`; `barnes-hut.html` retains the detailed tree lab. This UI upgrade supplies no native GPU timing evidence and does not change BH #2D evidence-pending or BH #2E promotion gates.
10 changes: 10 additions & 0 deletions barnes-hut.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,13 @@ footer { min-height: 40px; border-top: 1px solid var(--line); color: var(--muted
.readouts div { border-right: 0; border-bottom: 1px solid var(--line); }
.readouts div:last-child { border-bottom: 0; }
}

/* N-body observatory controls. */
.gesture-note { color: var(--muted); font-size: 0.7rem; align-self: center; margin-left: auto; }
#nbodyCanvas { touch-action: none; cursor: grab; }
#nbodyCanvas:active { cursor: grabbing; }
:focus-visible { outline: 2px solid var(--hot); outline-offset: 3px; }
input[type="range"], input[type="checkbox"] { accent-color: var(--hot); }
@media (max-width: 560px) {
.gesture-note { margin-left: 0; width: 100%; line-height: 1.5; }
}
4 changes: 2 additions & 2 deletions barnes-hut.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<p class="eyebrow">QSOL-IMC / GALAXY / SELF-GRAVITY LAB</p>
<h1>BARNES–HUT</h1>
</div>
<nav><a href="index.html">Main instrument</a><a href="https://github.com/QSOLKCB/GALAXY">Source ↗</a></nav>
<nav><a href="index.html">N-body simulator</a><a href="https://github.com/QSOLKCB/GALAXY">Source ↗</a></nav>
</header>

<main class="layout">
Expand Down Expand Up @@ -48,7 +48,7 @@ <h1>BARNES–HUT</h1>
<details class="note" open>
<summary>What changed?</summary>
<p>This lab is a separate self-gravitating execution path. Every resident body contributes mass to a deterministic quadtree. Distant cells may be replaced by their centre of mass when <code>s / d &lt; θ</code>; nearby cells are opened. A kick–drift–kick leapfrog step rebuilds the tree after the drift.</p>
<p>The main GALAXY rotation-law instrument remains unchanged. Its huge logical populations are sampled independent test particles; they are not silently reinterpreted as mutually interacting bodies. This lab keeps the resident population explicit because self-gravity creates cross-particle coupling.</p>
<p>The <a href="rotation-lab.html">GALAXY rotation-law instrument</a> remains available separately. Its huge logical populations are sampled independent test particles; they are not silently reinterpreted as mutually interacting bodies. This lab keeps the resident population explicit because self-gravity creates cross-particle coupling.</p>
</details>
</section>

Expand Down
33 changes: 32 additions & 1 deletion docs/BARNES-HUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

GALAXY now has two deliberately distinct dynamics families:

1. **Prescribed-field / test-particle modes** — the existing browser, CPU and GPU paths. These retain huge logical address spaces because individual resident particles do not affect one another.
1. **Prescribed-field / test-particle modes** — the rotation-law browser instrument (`rotation-lab.html`), CPU and GPU paths. These retain huge logical address spaces because individual resident particles do not affect one another.
2. **Resident self-gravity** — the Barnes–Hut laboratory. Every resident body's mass contributes to the force field, so the complete interacting resident set is explicit and cannot be substituted by independent logical-u64 tiles.

## Why Barnes–Hut
Expand Down Expand Up @@ -55,6 +55,9 @@ A future GPU implementation should preserve this CPU/direct reference as its cor

## Visualization

`index.html` is the default lightweight N-body observatory. It reuses the verified browser force solver with 768 resident bodies by default (128–2,048 selectable), fixed-rate leapfrog scheduling, seeded presets, optional trails and luminous sprites. Rendering contributes no additional gravitational mass. Orbit/zoom controls project the planar dynamics without modifying them. At 4× speed on an ordinary 60 Hz display, each rendered frame advances four physics steps. After a render gap the scheduler may batch up to 24 steps, derived from the 100 ms elapsed-time cap, then discards any remaining overload debt; hidden tabs suspend physics and under sustained load simulated time advances more slowly. Force probes pause the simulation so their result remains attached to the displayed state.


`barnes-hut.html` is an offline browser laboratory. It renders the resident bodies and can overlay quadtree cells while the system evolves. Controls expose:

- resident body count;
Expand Down Expand Up @@ -289,6 +292,34 @@ Kernel families are batched into command buffers to avoid measuring one CPU/GPU

Receipts classify the selected adapter as either `software-validation` or `hardware`. `--require-hardware` rejects software adapters. Mesa/llvmpipe timing is therefore correctness and diagnostic evidence only; a hardware performance claim requires a receipt from a real GPU.

### Real-hardware sweep

`scripts/bench-bh2d-hardware.py` is the evidence runner for the remaining BH #2D hardware item. It executes a strictly increasing resident-body sweep through `galaxy-bh-gpu-tree-parallel --require-hardware`, refuses a dirty tracked source tree or an existing evidence directory, validates every receipt, requires one adapter identity for the complete sweep, and hashes each receipt/log into `manifest.json`.

The default sweep is:

```text
512 -> 1024 -> 2048 -> 4096 -> 8192 -> 16384 -> 32768 -> 65536
```

Counts through 4,096 retain repeat-matched BH #2C timing. Larger points explicitly require the BH #2C and bounded full-oracle skips already encoded by the verifier; they do not silently drop those gates.

Example on a real GPU:

```bash
sh scripts/bench-bh2d-hardware-launch.sh \
--output runs/bh2d-hardware-sweep \
--adapter 0
```

A completed scaling manifest is hardware evidence for the exact recorded source, workload and adapter. It does **not** by itself promote BH #2D to production or establish a host-independent speed claim.

## Next rung

After real-hardware BH #2D receipts exist, BH #2E can evaluate scaling, memory/capacity limits and production promotion while retaining BH #2A/B2B2/B2C as frozen oracles.

### Hardware harness launch and toolchain boundary

Launch real evidence capture through the clean launcher: `sh scripts/bench-bh2d-hardware-launch.sh ...` on POSIX or `scripts\\bench-bh2d-hardware-launch.cmd ...` on native Windows. The launcher starts isolated Python under a newly constructed environment so inherited loader-injection variables are not resident in the evidence process. Direct Python execution is rejected. Imported use by the unit-test runner is for host validation only.

The harness now selects and records a platform-specific tool boundary. Linux uses the system compiler/linker/Git path, macOS uses the native system paths plus standard Homebrew locations, and Windows records Git plus any active MSVC/LLVM linker tools before narrowing the build PATH to those resolved tool directories. Cargo and rustc are recorded separately from rustup proxies and invoked through their resolved binaries. The OS, installed system libraries and toolchain are trusted host prerequisites; this is provenance checking, not a sandbox against a hostile host. Git checks clear ambient `GIT_*` selectors and bind the checkout explicitly, including linked worktrees. Relative `CARGO_HOME` is interpreted from Cargo's repository working directory. Logs preserve raw bytes, receipt parser failures enter the failed-manifest path, and workload values are validated before any output is created. Manifests serialize strict JSON.
2 changes: 1 addition & 1 deletion docs/ENGINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ represent a 2³² logical population. WebGL context loss stops the current recor
and switches to a fresh Canvas element with the smaller sample.

The payload is base64 in an external classic script, avoiding fetch and file-URL
CORS restrictions when opening `index.html` directly. It needs no `eval`, no
CORS restrictions when opening `rotation-lab.html` directly. It needs no `eval`, no
worker, no remote package, and no cross-origin-isolation headers. CSP explicitly
permits Wasm compilation using `wasm-unsafe-eval`. Compilation failure uses the
bounded JavaScript fallback and is reported in the interface.
Expand Down
Loading
Loading