Expand description
Phase 2b — typed-ID newtypes for ML metadata. Currently provides
only ParamIdx, used by crate::ml::AdamState and SgdState.
Phase 2b — typed-ID newtype(s) for ML metadata in cjc-runtime.
Currently provides only [ParamIdx], used by crate::ml::AdamState
and crate::ml::SgdState to type optimizer-state buffers.
§Why a separate file from cjc-ad/src/idx.rs?
Phase 2a (PR #8) introduced NodeIdx, ParamIdx, LayerIdx in
cjc-ad/src/idx.rs. Architecturally those newtypes belong in
cjc-runtime (the foundation crate, upstream of cjc-ad), but
moving them at this stage would conflict with Phase 2a’s open PR
diff. Instead, this Phase 2b PR defines ParamIdx locally in
cjc-runtime for the optimizer-state migration; a future
“Phase 2 cleanup” PR will consolidate the typed-ID newtypes in
one canonical home.
Until then, cjc_runtime::idx::ParamIdx and
cjc_ad::idx::ParamIdx are distinct types with identical shape.
They are not used in the same code today, so the duplication is
harmless.
§Repr
repr(transparent) over u32: ABI-identical to u32, zero
runtime overhead, FFI-stable bit pattern.
Structs§
- Param
Idx - Index into a per-parameter optimizer-state buffer.