Codebase map
This map groups the Cacheon source by authority boundary. File names are links to the current code repository; source remains authoritative when details change.
Read by authority, not import depth
The easiest way to get lost in Cacheon is to follow imports as though every module had the same trust level. Start from the decision whose authority you are trying to understand:
The local branch is useful to contributors but cannot crown anything. The intake, arena, qualification, settlement, and weight branch owns hostile evaluation and economic state. A sealed direct artifact enters qualification through the registered prebuild/runtime boundary; after integration review, its sealed native publication is bound to the reviewed integrated source.
Contribution contract
| Area | Primary source |
|---|---|
| Bundle parsing and path rules | manifest.py |
| Slot ABI and trusted references | slots.py |
| Target identity and composition | target_catalog.py |
| Typed tensor/output boundary | tensor_spec.py |
| Static policy | sandbox.py |
| Tracing-JIT admission | dsl_jit_policy.py |
| Local and distributed verification | verify.py, verify_collective.py |
| SGLang dispatch | dispatch.py, seams.py |
| Scheduler-role candidate load | seam.py, sglang_scheduler_gate.py |
Sealed direct artifacts
| Area | Primary source |
|---|---|
| Closed provider policy | artifact_provider.py |
| Slot call ABI, resources, and lifecycle | artifact_abi.py, artifact_runtime.py |
| Canonical direct-execution identity | artifact_identity.py, artifact_resource_identity.py |
| Declarative device launch | artifact_device_launch.py |
| CUBIN ABI and Driver admission | cuda_cubin.py, cuda_launch.py |
| Parameter, TMA, and FastDivmod materialization | cuda_materialize.py |
| CuTe compiler boundary and sealed index | cute_aot.py, cute_cubin.py |
| Measured compile profile | eval/native_compile_profile.py |
| Registered build patcher | patchers/build_cute_cubin.py |
| Rank-local post-CUDA binding | integrations/sglang_artifact_context.py |
Intake and referee
State, economics, and weights
| Area | Primary source |
|---|---|
| Evaluation/release stack identities | stack_manifest.py |
| Transactional settlement state | chain/intake.py |
| Pure emissions projection | economics.py |
| Weight publication reconciliation | chain/weights.py |
| Reserved V2 durable schema | chain/reserved_schema.py |
| Copy and attribution evidence | copy_fingerprint.py |
Engine integration
| Area | Primary source |
|---|---|
| Deterministic Engine tree | engine_tree.py |
| Model provisioning | model_provision.py |
Compatibility
| Area | Primary source |
|---|---|
| SGLang pin and canary | compat.py |
| Bittensor SDK canary | chain_canary.py |
Follow a concrete task
“Why was this bundle rejected?”
Read in this order:
manifest.pyfor exact TOML shape and contained-path rules;sandbox.pyanddep_policy.pyfor observed source/build features;target_catalog.pyfor target resolution and admitted features;artifact_provider.pyandartifact_abi.pywhen the row declares direct exports;slots.pyandtensor_spec.pyfor callable/output semantics; andverify.pyorverify_collective.pyfor executable correctness.
This ordering separates syntax, capability admission, ABI, and numerical failure. They are different diagnoses even when the CLI reports them in one run.
“How did a finalized reveal become a crown?”
Start at chain/intake.py, then follow chain/fetch.py and
chain/publication.py into chain/validator_loop.py. The loop resolves the
closed ArenaServiceRegistry, receives screening and qualification work,
persists evidence references, and invokes transactional settlement. Read
eval/qualification_runner.py alongside eval/qualification.py: the runner
orchestrates work; the schema and regrader define what counts as authority.
The first matching PASS leaves reproduction pending. A second distinct, matching PASS may settle the contribution and advance the evaluation stack. Console output and evaluator summary text are never the settlement input.
“Why did weight publication remain pending?”
Read economics.py first: it computes the pure global projection from reopened
active contribution state. Then read chain/weights.py: it refreshes the live
metagraph, journals intent before submission, records SDK results without
treating them as confirmation, and reconciles later chain observation. The journal stores
status/chronology metadata and a projection digest, not raw pre/post readback vectors.
--dry-run creates no journal intent, while reconciliation and submission have
different durable states.
“What exactly ships?”
Follow stack_manifest.py into engine_tree.py and model_provision.py.
The selected payload remains bound to its crowned digest; later
materialization owns deterministic module namespaces and packaging. The
signed chain-independent release product (release.py, release_runtime.py,
release_host.py, release-verify/release-context) was removed on
2026-08-19: no release has ever been produced or consumed, and the subnet does
not need it to run.
State and evidence locations
| Object | Owner | Identity / persistence rule |
|---|---|---|
| Parsed bundle | Contributor/diagnostic process | Content hash over the admitted bundle tree |
| Finalized publication | Intake controller | Validator-owned immutable worker publication |
| Qualification evidence | External evidence root plus deployment-owned expected plan/provider context | Typed attempt and referenced artifacts; full regrade additionally requires reconstructed CausalQualificationInput, while settlement restart performs narrower byte/PASS authentication |
| Evaluation stack | Referee state | Canonical manifest that may reference hostile proposals |
| Settlement and weight state | Chain-scoped SQLite controller | Transactional single-writer state plus projection-linked intent/status journal; live readback vectors are not serialized |
| Validator recovery snapshot | Private S3-compatible object store | Consistent SQLite image plus database-referenced publications/evidence, redacted journal, and explicit sealed inputs under a closed digest-bound manifest; staged restore never replaces live state |
| Integrated source | Reviewed source control | Full reviewed commit plus selected-payload and attribution digests |
Paths are deliberately not identities. A local directory name, URL, database row number, or registry tag cannot replace the corresponding digest-bound object.
Tests as executable maps
Tests mirror the authority boundaries rather than one monolithic integration fixture:
test_static.pyandtest_target_catalog.pycover hostile input and target admission;test_artifact_abi.py,test_artifact_device_launch.py,test_artifact_runtime.py,test_cuda_cubin.py,test_cuda_materialize.py, andtest_cute_cubin.pycover the sealed direct-artifact boundary;test_stack_manifest.py, stack-planning tests, andtest_engine_tree.pycover canonical composition and integration materialization;- qualification, OCI, audit, and reference-protocol tests cover current v7 resident B/C/[B′], v8 two-process B/C/B′, registered eager audit A, and pristine T, while historical-policy tests preserve older witness shapes;
- chain-intake, settlement, economics, and weight-publication tests cover durable economic transitions;
test_chain_publish.pyandtest_chain_archive.pycover public proposal transport and private digest-bound recovery respectively; and- release, runtime, registry, and host tests cover the signed serving boundary.
When learning a type, search for both its successful construction and its rejection tests. The negative cases usually reveal which fields are security inputs rather than descriptive metadata.
Production authority entry points
Development helpers and test fixtures are not alternate qualification authorities. Audit production intake from the validator loop and durable intake store, then follow the registered arena, qualification runner, settlement transition, and weight-publication journal. A path that does not emit and reopen the typed products for those boundaries cannot substitute for them.
Tests are organized under tests/ by the same boundaries. Contract tests are
often the clearest executable examples because they build exact typed objects
and assert fail-closed behavior.
Arena service types
An arena service is the validator-owned admission, screening, and qualification-planning boundary for an admitted proposal. The downstream qualification and durable controller produce and settle authoritative evidence…
Glossary
Arena : Validator-owned hardware, workload, policy, and service boundary for one qualification domain.