How autarkis/chitin works
Chitin compiles meshes, point clouds, Gaussian fields, and skinned assets into convex colliders and portable .phys artifacts. The principal workflow is input analysis and planning, geometry reconstruction/decomposition, verification and profile-based acceptance, then artifact export. It can run through Python or a Worker-hosted browser WASM compiler; a local job service wraps the Python compiler, and engine integrations consume the shared artifact. README documents the broad compiler and integration capabilities; several internal Python links are inferred only at subsystem level because their implementation excerpts were not provided.
Main entry points: core.py Compiler orchestration · worker.py Job runner · phys.py PHYS format · worker.ts Compiler worker
Components 26
Python compiler
- CLI
src/chitin/cli.py - Input adapters
src/chitin/adapters - Analyze and plan
src/chitin/analyze.py - Compiler orchestration
src/chitin/core.py - Surface reconstruction
src/chitin/stages/reconstruct.py - Geometry stages
src/chitin/stages - Geometry verification
src/chitin/verify/sweep.py - Profile acceptance
src/chitin/acceptance.py - Compilation result
src/chitin/result.py - Reports and provenance
src/chitin/report.py - Artifact exporters
src/chitin/exporters - PHYS format
src/chitin/phys.py
Browser compiler
- Browser compiler API
integrations/wasm-lite/src/compiler.ts - Worker client
integrations/wasm-lite/src/worker-client.ts - Compiler worker
integrations/wasm-lite/src/worker.ts - WASM decomposition
integrations/wasm-lite/src/decompose.ts - Worker protocol
integrations/wasm-lite/src/worker-protocol.ts
Local build service
- Job API
src/chitin_service/app.py - Job runner
src/chitin_service/worker.py - Job and artifact store
src/chitin_service/store.py
Artifact consumers
- Web PHYS reader
integrations/web/src/phys-parser.ts - Unity importer
integrations/unity/Editor/PhysImporter.cs - Unreal importer
integrations/unreal/Source/ChitinImporter/Private/ChitinPhysReader.cpp
WASM compute
- Native WASM modules
integrations/wasm/src
Other components
- Asset author
- Physics runtime
Connections 31
- Asset author → CLI: submits asset
README.md - CLI → Compiler orchestration: invokes compiler
README.md - Asset author → Browser compiler API: submits asset
README.md - Browser compiler API → Worker client: dispatches work
README.md - Worker client → Compiler worker: posts requests
integrations/wasm-lite/src/worker-client.ts - Compiler worker → Worker protocol: uses messages
integrations/wasm-lite/src/worker.ts - Compiler worker → WASM decomposition: calls decomposition
integrations/wasm-lite/src/worker.ts - WASM decomposition → Native WASM modules: runs WASM
- Compiler orchestration → Input adapters: loads geometry
- Compiler orchestration → Analyze and plan: analyzes input
- Compiler orchestration → Surface reconstruction: requests reconstruction
- Compiler orchestration → Geometry stages: runs pipeline
- Compiler orchestration → Geometry verification: checks geometry
- Compiler orchestration → Compilation result: builds result
- Profile acceptance → Geometry verification: reads metrics
src/chitin/acceptance.py - Compiler orchestration → Profile acceptance: evaluates build
- Compiler orchestration → Artifact exporters: writes artifacts
- Artifact exporters → PHYS format: writes PHYS
- Asset author → Job API: submits job
src/chitin_service/app.py - Job API → Job and artifact store: stores job
src/chitin_service/app.py - Job API → Job runner: runs job
src/chitin_service/app.py - Job runner → Job and artifact store: updates job
src/chitin_service/worker.py - Job runner → Profile acceptance: evaluates result
src/chitin_service/worker.py - Job runner → Compiler orchestration: calls extract
src/chitin_service/worker.py - Job runner → Artifact exporters: exports artifacts
src/chitin_service/worker.py - PHYS format → Web PHYS reader: reads artifact
README.md - PHYS format → Unity importer: imports artifact
integrations/unity/Editor/PhysImporter.cs - PHYS format → Unreal importer: reads artifact
README.md - Web PHYS reader → Physics runtime: loads colliders
README.md - Unity importer → Physics runtime: creates colliders
README.md - Unreal importer → Physics runtime: loads hulls
README.md