makepad/xr/tests/HOWTO.md
Admin d2130e6550 libs: model, mesh_edit, csg, scene, sim, render, xr
Squash of 25 work commits (Sep 1–12):
  237da90  render: the sprite lane hands the screen draw back the way it found it
  895b9a7  particles: an emitter can ride a body's own frame
  914471f  ai-hub: a feed session whose last socket left ends on its idle timeout; skin: parent, skinned centroid and a nodes-only rig for retargets
  3fcccf3  sim: the whole world is implicitly editable, and one seam says where the ground is
  5692fab  sim: the landform world proves itself — walker through the tunnel included
  f4af6df  sim: terrain knows who changed it — a plan layer over player history
  adbb078  render: a water volume can be physics without a picture
  c17480f  render: a non-rigid body may carry its own orientation
  acad401  sim: an agent with no route holds and retries instead of walking into the wall
  22b2bf9  sim + chat: the composed world surface takes a map floor; the chat gets plan tools
  faf8112  web path: the tessellator's lap timer, the trace span and the fusion cycle timer have no clock on the web
  d3472eb  tsdf: the clock-taking XR helpers are native-only — the browser has no depth camera and no Instant
  4946c9e  sim + render: a repaint is not a world edit — colour and glow restyles never rebake the lightmap
  4317f58  sim + render + chat: walk decks as a surface, the filmed body is no obstruction, the brief never asks
  9791279  render: support rigged models and custom materials across viewers
  3ce2792  sim: use deck geometry for collision and sensing
  c8b79ff  Add portable PBR, rig and soft-body authoring support
  108d423  Add transactional polygon modeling and editable asset documents
  38f4d3b  Refine editable modeling and firm yarn character behavior
  08a2637  sim: add entity-owned lights and vehicle headlights
  00d96a7  render: add clustered lights, local shadows and incremental GI
  cf916af  render: import glTF asset extensions and wire clustered GI
  c6d2cca  model: cut transaction memory and raise capacity limits
  41af47a  raytrace: add a CPU probe-ray BVH budget example
  c963d0a  libs: the game sim splits into makepad-scene and makepad-soft-body; render, model, fab and the asset importer retarget

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-15 13:40:31 +02:00

95 lines
3.3 KiB
Markdown

# XR Gpusim Test HOWTO
These XR UI loopback tests are integration-test crates gated with:
```rust
#![cfg(gpusim)]
```
So run them with both:
- `MAKEPAD=gpusim`
- `RUSTFLAGS='--cfg gpusim'`
`MAKEPAD=gpusim` enables the gpusim (simulated-GPU) backend in Makepad itself.
`RUSTFLAGS='--cfg gpusim'` makes Cargo compile the integration test file at all.
The test harnesses already use gpusim `no-draw` mode internally via
`Cx::gpusim_no_draw_event_loop_for_draw_cycles(...)`.
That means they still run the event loop and draw-time code paths, but skip actual GPU/UI raster work.
Use `--release` for the loopback multiplayer tests.
## Shooter Loopback
Build only:
```sh
RUSTFLAGS='--cfg gpusim' MAKEPAD=gpusim cargo test -p makepad-xr --test ui_shooter_loopback --no-run
```
Single-app sanity:
```sh
RUSTFLAGS='--cfg gpusim' MAKEPAD=gpusim cargo test --release -p makepad-xr --test ui_shooter_loopback single_gpusim_shooter_app_emits_projectiles_from_synthetic_xr_updates -- --nocapture
```
Two-app loopback replication:
```sh
RUSTFLAGS='--cfg gpusim' MAKEPAD=gpusim cargo test --release -p makepad-xr --test ui_shooter_loopback two_gpusim_shooter_apps_emit_and_replicate_projectiles_over_loopback -- --nocapture
```
Desktop-like observer path:
```sh
RUSTFLAGS='--cfg gpusim' MAKEPAD=gpusim cargo test --release -p makepad-xr --test ui_shooter_loopback two_gpusim_shooter_apps_replicate_projectiles_to_desktop_like_observer -- --nocapture
```
Desktop-like wall-bounce regression:
```sh
RUSTFLAGS='--cfg gpusim' MAKEPAD=gpusim cargo test --release -p makepad-xr --test ui_shooter_loopback two_gpusim_shooter_apps_replicate_wall_bounces_to_desktop_like_observer -- --nocapture
```
OpenXR aim-point replication:
```sh
RUSTFLAGS='--cfg gpusim' MAKEPAD=gpusim cargo test --release -p makepad-xr --test ui_shooter_loopback two_gpusim_shooter_apps_emit_and_replicate_projectiles_from_openxr_aim_point -- --nocapture
```
Ignored long-hold regressions:
```sh
RUSTFLAGS='--cfg gpusim' MAKEPAD=gpusim cargo test --release -p makepad-xr --test ui_shooter_loopback two_gpusim_shooter_apps_keep_replicating_projectiles_during_long_hold -- --ignored --nocapture
```
```sh
RUSTFLAGS='--cfg gpusim' MAKEPAD=gpusim cargo test --release -p makepad-xr --test ui_shooter_loopback two_gpusim_shooter_apps_repro_frozen_observer_projectiles -- --ignored --nocapture
```
## Shared Object Loopback
Build only:
```sh
RUSTFLAGS='--cfg gpusim' MAKEPAD=gpusim cargo test -p makepad-xr --test ui_shared_object_loopback --no-run
```
Single-app shared-cube sanity:
```sh
RUSTFLAGS='--cfg gpusim' MAKEPAD=gpusim cargo test --release -p makepad-xr --test ui_shared_object_loopback single_gpusim_shared_cube_app_grabs_moves_and_releases_cube -- --nocapture
```
Two-app shared-cube loopback:
```sh
RUSTFLAGS='--cfg gpusim' MAKEPAD=gpusim cargo test --release -p makepad-xr --test ui_shared_object_loopback two_gpusim_shared_cube_apps_take_over_and_release_cube_over_loopback -- --nocapture
```
## Notes
- These multiplayer tests bind localhost UDP/TCP ports. If you run them in a restricted sandbox, socket bind can fail.
- `--nocapture` is useful because test failures include detailed app state dumps.
- The shooter harness uses bounded gpusim draw cycles, so peer discovery still needs some real-time slack; if you add new long-running cases, prefer copying the existing `run_test_app_with_limits(...)` pattern.