Skip to content

fma: (place:tissue) render convergence + /fma-body cockpit + 1M SoA scan PoC#59

Merged
AdaWorldAPI merged 3 commits into
mainfrom
claude/charming-johnson-ufstpw
Jun 24, 2026
Merged

fma: (place:tissue) render convergence + /fma-body cockpit + 1M SoA scan PoC#59
AdaWorldAPI merged 3 commits into
mainfrom
claude/charming-johnson-ufstpw

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Builds on the merged fma/ plateau (#56). Three commits, all additive — the only non-fma/ change is one import + one route in cockpit/src/main.tsx (verified: no /torso* line touched; #57/#58 untouched).

1 · v3 render convergence — Located skeleton + connected_to + key-driven solid render (492cf934)

Converges both the baked address and the render onto the canonical (place:tissue) key:

  • Located skeleton (converge) — classid-dispatched OGAR HhtlMode. For 0x0A02 bones with a mesh centroid, the place high-bytes are the Morton spatial cell of the centroid (the exact anchor is the key); soft tissue (0x0A01) keeps the part_of Cascade rank. Both keep is_a in the low byte. Verified: thoracic vertebrae T9/T10/T11 share a Morton HEEL (same octant), descend in HIP/TWIG as their centroids descend.
  • connected_to (converge) — the canonical EdgeBlock: part_of siblings are the in-family adjacency (the aortic segments / heart chambers that physically connect). Emits render-ready nodes.tsv + edges.tsv. 6289 edges / 1368 nodes.
  • Key-driven solid render (new graph) — the SOLID triangle surface (same z-buffer + Gouraud as mesh), colored by the tissue byte, with a GUID prefix that selects the subtree: graph … 00000a02 renders just the skeleton (922K triangles). The address routes the geometry.

FMA skeleton, selected by GUID prefix

2 · /fma-body cockpit page — layer toggles + transparency (d75ef844)

My interactive full-body viewer, additive to /torso*:

  • cockpit_bake (new fma bin) bakes the body → cockpit/public/fma_body.mesh (the same SPM1 wire the cockpit decodes, but the per-vertex opacity byte carries a clean layer id), vertex-cluster decimated. 329K verts / 745K tris.
  • cockpit/src/FmaBody.tsx renders the solid THREE.Mesh (same (-x,z,y) upright decode as TorsoMesh) with per-layer toggle buttons (skin / muscle / organ / skeleton / vessel / nerve) + a solid↔transparent switch — each layer gated by the converged key in-shader.
  • /fma-body route added (additive).

npm run build (tsc + vite) is green (102 modules). Live browser render not exercised here (no browser) — mirrors the working TorsoMesh and shares its decode. Needs a cockpit redeploy to go live.

3 · soa_scan — 1M-row SoA scalability PoC (05752598)

Proves the canon's "the key prerenders nodes with zero value decode" at scale. NodeRow = 512 B = key(16) + edges(16) + value(480); columnar SoA. Key-only prefix-route scan vs full value-decode scan, best-of-7, x86-64-v4:

rows key-only (route) value (decode slab) speedup
64 000 2209 M/s · 35.3 GB/s 17 M/s · 8.1 GB/s 130×
256 000 1581 M/s · 25.3 GB/s 17 M/s · 8.1 GB/s 94×
1 000 000 1507 M/s · 24.1 GB/s 17 M/s · 8.1 GB/s 89×

Key-only stays ~1.5 G rows/s and flat as N grows (the 16 MB key column is cache-resident); the value scan is RAM-bound over 480 MB. 30× is the pure memory floor; ~90× adds cache residency + per-row slab decode. (1M is synthetic — real FMA is ~1368 placed / ~75K terms; throughput is the point.)


Scope / safety: every change is under fma/ except the additive cockpit page; /torso, /torso-live, /torso-splat, /torso-map and torso.mesh are byte-for-byte untouched. All new fma bins are dep-free (png + std) and clippy-clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GJ4NVBSjq1w5h7RmTbVafb


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added a new full-body FMA viewer with layer toggles, solid/transparent display, and navigation controls.
    • Added a new /fma-body page for browsing the combined body mesh.
    • Added tools to generate and render the combined body mesh and related converged data.
    • Added a benchmark utility for comparing key-only and full-data scan performance.
  • Documentation

    • Updated FMA docs to cover the new body-mesh workflow, binaries, and rendering approach.

claude added 3 commits June 24, 2026 14:02
…key-driven solid render

Converges BOTH the baked address AND the render onto the canonical (place:tissue) key,
across three additive slices (all under fma/, zero change to existing bins):

1. Located skeleton (converge.rs) — classid-dispatched HhtlMode. For 0x0A02 bones with
   a mesh centroid, the `place` high-bytes are the Morton spatial cell of the centroid
   (the exact anchor IS the key — the anchor.rs hybrid); soft tissue (0x0A01) keeps the
   part_of Cascade rank. Both keep is_a in the low byte. Verified: thoracic vertebrae
   T9/T10/T11 share Morton HEEL (same octant), descend in HIP/TWIG as their centroids
   descend; 369 Located via centroid, 0 collisions.

2. connected_to (converge.rs) — the canonical EdgeBlock: part_of siblings are the
   in-family adjacency (the aortic segments / heart chambers that physically connect),
   the is_a parent is the out-of-family link. Emits nodes.tsv + edges.tsv (render-ready).
   6289 edges over 1368 nodes.

3. Key-driven solid render (new graph.rs) — renders the SOLID triangle surface (the same
   z-buffered Gouraud rasterizer as mesh.rs), but driven by the converged key: every mesh
   colored by its `tissue` byte (is_a), and a GUID **prefix** SELECTS which addressed
   subtree draws — `graph … 00000a02` renders just the skeleton (922K triangles), the
   address routing the geometry. The deepest-FMA pick keys each bone mesh to its skeletal
   leaf (not a soft-tissue parent).

converge gains optional args [parts_dir] [element_parts]; absent ⇒ Cascade + structural
edges only (still runs on the committed trees). graph is dep-free (png + std), like the
rest of the crate. docs/graph_skeleton.png shows the prefix-selected skeleton.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GJ4NVBSjq1w5h7RmTbVafb
…er toggles + transparency

Adds MY interactive cockpit viewer, additive to the other session's /torso* (#57/#58 —
their TorsoMesh/torso.mesh are untouched; main.tsx gains only one import + one route).

- cockpit_bake (new fma bin): bakes the full body → cockpit/public/fma_body.mesh, the
  same SPM1 wire the cockpit already decodes, but the per-vertex `opacity` byte carries a
  clean LAYER id (1 skin·2 muscle·3 organ·4 skeleton·5 vessel·6 nerve·7 connective·8 other)
  instead of a continuous alpha — so each layer can be toggled exactly. Color is the
  converged `tissue` byte (is_a); geometry is the BodyParts3D is_a OBJ set, vertex-cluster
  decimated (a Rust port of bake_torso_mesh.py's cluster_decimate). 329K verts, 745K tris.

- cockpit/src/FmaBody.tsx (new): loads /fma_body.mesh, renders the solid THREE.Mesh with
  the same (-x,z,y) upright decode as TorsoMesh (head-up), and a shader that gates each
  layer via uEnabled[9] (indexed by the vertex layer id) + a global alpha. UI: a button
  per layer (skin/muscle/organ/skeleton/vessel/nerve) toggling visibility, and a
  solid↔transparent switch. Skin off by default so the anatomy shows.

- cockpit/src/main.tsx: + route /fma-body (additive; /torso* unchanged).

- README: fix the v3 image (the removed dot-graph PNG → the skeleton render) and document
  cockpit_bake + /fma-body.

Verified: cockpit `npm run build` (tsc && vite build) is green (102 modules). The live
browser render was not exercised in this environment (no browser) — the component mirrors
the working TorsoMesh exactly and shares its decode, so it should render head-up on deploy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GJ4NVBSjq1w5h7RmTbVafb
Proves the OGAR canon's "the key prerenders nodes with zero value decode" at scale.
A NodeRow is 512 B = key(16) + edges(16) + value(480); laid out columnar (SoA) as a
contiguous key column + value column, a key-only prefix-route scan (count the skeleton
subtree by classid 0x0A02 — the same routing /fma-body's skeleton button does) touches
~30x less memory than materializing the value slab, and is cache-resident at the key
column's size.

Measured (best-of-7, x86-64-v4):
  rows     key-only (route)      value (decode slab)   speedup
  64000    2209 M/s  35.3 GB/s   17 M/s   8.1 GB/s      130x
  256000   1581 M/s  25.3 GB/s   17 M/s   8.1 GB/s       94x
  1000000  1507 M/s  24.1 GB/s   17 M/s   8.1 GB/s       89x

key-only stays ~1.5 G rows/s and flat as N grows (the 16 MB key column at 1M is cache-
resident); the value scan is RAM-bandwidth-bound over 480 MB. The 30x is the pure memory
floor; the ~90x adds the key column's cache residency + the per-row slab decode work.

1M is synthetic (real FMA ~1368 placed / ~75K terms — the throughput is the point), seeded
by the FMA addressing distribution. Dep-free (std only), like the rest of the crate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GJ4NVBSjq1w5h7RmTbVafb
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 46e4ba37-2fd6-4bc8-b8cd-ce484f2fa902

📥 Commits

Reviewing files that changed from the base of the PR and between a972adc and 0575259.

⛔ Files ignored due to path filters (1)
  • fma/docs/graph_skeleton.png is excluded by !**/*.png
📒 Files selected for processing (9)
  • cockpit/public/fma_body.mesh
  • cockpit/public/fma_body.mesh.manifest.json
  • cockpit/src/FmaBody.tsx
  • cockpit/src/main.tsx
  • fma/README.md
  • fma/src/bin/cockpit_bake.rs
  • fma/src/bin/converge.rs
  • fma/src/bin/graph.rs
  • fma/src/bin/soa_scan.rs
 _________________________________________________________________________
< Yo dawg, I heard you like code reviews, so I reviewed your code review. >
 -------------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AdaWorldAPI AdaWorldAPI merged commit 03e8982 into main Jun 24, 2026
3 of 4 checks passed
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants