Manuscript Psy03-A@1 · Psy03-A.tex · section · b30eb6e9
A compact CPU repair core
A compact CPU repair core · lines 2221–2242
The listing below is independently extractable Python. It reproduces the forward ordering and provides exact-count mask operations, explicit streams, phase-boundary checkpoints, and stage-separated evaluation. It is not a full rerun of all original sweeps.
The code uses stored zero weights for ambient regrowth scoring. Normal training reapplies masks after every Adam step. The optimizer is fresh for each call, matching the source's reset convention. The returned optimizer and generator states support provenance; the phase checkpoint below is used only when a fresh optimizer will be created.
Stable sorting implements flattened-index tie breaking PyTorchArgsort. The implementation is CPU-specific. Software version and environment remain part of a reproduction record PyTorchRandom.