# Habitat navigation reproduction

This recipe records one ReplicaCAD apartment layout with Habitat-Lab and
Habitat-Sim 0.3.3. It does not acquire HM3D or reproduce a learned-policy result.
Run it on Linux x86-64 with a desktop EGL/OpenGL driver. The reviewed machine
used Intel Arc and Mesa 25.0.7. Phone testing is deferred.

The three `*-tree.json` files preserve official Hugging Face repository metadata
at the commits checked by `habitat_navigation.py`. Every acquired Git/LFS object
is checked against that metadata. The complete small ReplicaCAD/Fetch source
snapshots and the episode's YCB dependency closure total 727 files / 206,312,443
bytes; the official episode archive adds 214,815,852 bytes to the local cache.
Only the selected scene's graphics closure enters the display export.

ReplicaCAD and YCB assets are CC-BY-4.0. Fetch is CC-BY-NC-SA-4.0; its geometry
stays at commit-pinned upstream URLs in the browser scene. Native source files
are unchanged. Derived PNG textures retain the native Basis decoder's pixels,
with row storage changed to PNG order and legacy texture references converted
to standard glTF image references. Geometry buffers, mesh hierarchy, material
references, and UV coordinates remain source-exact.

From the repository root, choose a new cache directory and use micromamba 2.9.0
(the recording used Linux package `micromamba-2.9.0-0.tar.bz2`). No shell
initialization or global Python changes are needed:

```sh
habitat_cache="$(pwd)/.cache/habitat-reproduction"
mkdir -p "$habitat_cache"
git clone --branch v0.3.3 --single-branch https://github.com/facebookresearch/habitat-lab.git "$habitat_cache/habitat-lab"
git -C "$habitat_cache/habitat-lab" checkout --detach 094d6be2f9d057e4781a68ae792132895fd4d3d0
git clone --branch v0.3.3 --single-branch https://github.com/facebookresearch/habitat-sim.git "$habitat_cache/habitat-sim"
git -C "$habitat_cache/habitat-sim" checkout --detach acbe6f4922e68145e401e55c30f9dfea460a3f24
micromamba create --root-prefix "$habitat_cache/mamba-root" --prefix "$habitat_cache/env" --file scripts/worlds/locks/habitat/env-explicit.txt --yes
"$habitat_cache/env/bin/python" -m pip install --no-deps --require-hashes --no-build-isolation -r scripts/worlds/locks/habitat/pip-requirements.txt
"$habitat_cache/env/bin/python" -m pip install --no-deps --no-build-isolation "$habitat_cache/habitat-lab/habitat-lab"
"$habitat_cache/env/bin/python" -m pip check
python3 scripts/worlds/acquire_habitat_assets.py --cache "$habitat_cache"
```

The explicit conda lock contains package URLs and their MD5 digests. The native
recorder additionally requires Habitat-Sim's SHA-256
`9e36540385b6dd7749ecf0707513c68762eb0abe9455b2f2214bc4ac2030c596`.
The pip supplement pins source/wheel URLs and SHA-256 digests; it replaces
conda's Pillow with 10.4.0 to satisfy Habitat-Lab's metadata. Neither solver is
allowed to select newer dependencies. The locks were exercised in a separate
environment, which reproduced the original native samples and graphics bytes.

Record two independent executions sequentially. Recorder `--output` names are
relative to the cache; existing output directories are rejected.

```sh
OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 "$habitat_cache/env/bin/python" scripts/worlds/record_habitat_navigation.py --cache "$habitat_cache" --output native-a --seed 0
OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 "$habitat_cache/env/bin/python" scripts/worlds/record_habitat_navigation.py --cache "$habitat_cache" --output native-b --seed 0
"$habitat_cache/env/bin/python" scripts/worlds/convert_habitat_assets.py --cache "$habitat_cache" --run native-a --output "$habitat_cache/render-assets"
"$habitat_cache/env/bin/python" scripts/worlds/export_habitat_scene.py --cache "$habitat_cache" --run native-a --render-assets render-assets --output "$habitat_cache/scene-export"
bash scripts/viewer/build.sh --check
node scripts/worlds/verify_habitat_browser.mjs --export "$habitat_cache/scene-export" --run "$habitat_cache/native-a" --output "$habitat_cache/desktop-poses" --mode poses
node scripts/worlds/verify_habitat_browser.mjs --export "$habitat_cache/scene-export" --run "$habitat_cache/native-a" --output "$habitat_cache/desktop-playback" --mode playback
```

The browser checks use the pinned Playwright dependency installed by the viewer
build; install its Chromium browser with the local Playwright CLI if absent.
They start and close their own local HTTP server and browser. Run native,
texture-decoding, browser, and performance probes one at a time. These checks
cover the exported scene and shared viewer; application/production acceptance
requires separate checks after integration.

Publish only after the independent recordings and desktop checks pass. This
writes the scene, bounded episode chunks, native artifacts, evidence, and registry
into the current checkout; inspect the resulting diff before committing.

```sh
PYTHONPATH=scripts "$habitat_cache/env/bin/python" scripts/worlds/publish_habitat_recording.py --run "$habitat_cache/native-a" --repeat "$habitat_cache/native-b" --export "$habitat_cache/scene-export" --desktop "$habitat_cache/desktop-poses/report.json"
PYTHONPATH=scripts python3 -m worlds.habitat_registry
python3 scripts/catalogue_matrices.py
```

The catalogue card and source registry are authored separately. Follow the
repository README's data-release workflow when changing canonical claims or
sources, then stage and validate the complete site. Re-publication preserves the
native failed outcome; a different successful trial needs its own reviewed
identity and evidence.

The source task is `NavToObjTask-v0`, episode 0, minival, seed 0, FetchSuctionRobot,
and `v3_sc3_staging_18.scene_instance.json`. The source oracle coordinate action
receives the sampled goal as its look-at coordinate, using mode 1 to select a
navigable approach point. The source's 400-action horizon, sampled start/goal,
1.5 m horizontal success distance, facing-angle test, and stop requirement remain
unchanged. Base motion uses Habitat's NavMesh-constrained velocity action; it is
not a wheel-motor controller or a learned policy.

The reviewed execution fails at the source horizon: 401 states, 400 actions,
19.463999999999057 seconds, final distance 4.113487720489502 m, and success false.
Preserve native times: 367 intervals are approximately 48 ms and 33 are 56 ms.
Do not replace them with a nominal uniform 30 Hz clock. The raw physics-node
and graphics-instance streams are both retained; one cabinet part differs by
about 43 micrometres between a fixed physics attachment and its recorded graphics
pose. Replay each recorded stream directly. RGB capture is asynchronous; no
exact pixel-to-post-step synchronization is claimed.

Expected decompressed `samples.ndjson.gz` SHA-256:
`9402367cfc42f0305f0aff1cb2124cca6fea57afc683dd1159b573ecc7952ac8`.
Expected `native-gfx-replay.json` SHA-256:
`352684523ea1947ca9cad1fe117911b57c095102a9b17d3e23202ca7011f362a`.
Native reports seal all their artifacts and record distinct execution IDs.
Retain failed runs and their logs when diagnosing differences.

Source warnings about unselected `sc4` NavMeshes and the legacy Fetch 1.0 glob
remain in the logs. The selected `sc3` layout is present, and native execution
recomputes its NavMesh. This scene supplies no semantic room labels; do not
invent room names, additional houses, or an HM3D capability from it.
