CyberdyneLabs · Reports · PYTHON_QUARANTINE

PYTHON_QUARANTINE — runtime is C++/CUDA/Planck, Python is the surgery station behind glass

reports/PYTHON_QUARANTINE.md 760 words raw markdown ↗

PYTHON_QUARANTINE — runtime is C++/CUDA/Planck, Python is the surgery station behind glass

Doctrine, 2026-05-01. GIGACHAD_NATIVE is a sovereign C++/CUDA runtime. Python has no place in the living organism: not as router, not as organ logic, not as verifier in the production path, not as the thing deciding architecture. Python is allowed only as a disposable offline surgery capsule that produces non-Python artefacts the C++ runtime can mmap.


What is forbidden

A Python file that lives in src/ or build/ is a smell — investigate before merging.

What is allowed

Python is permitted only inside tools/surgery/, tools/bench/, or one-off scripts under scripts/, and only when the script is one of:

| Allowed Python role | Example | |-----------------------------------|--------------------------------------------------------| | Bench harness (offline) | tools/bench/mbpp_he_3mode.py, tools/bench/livecodebench_3mode.py, tools/bench/monster_integration_v1.py — call --chat, score outputs. Never live during user inference. | | Poison harvester | tools/surgery/bench_to_poison_dataset.py, tools/surgery/poison_to_dataset.py — read DAG / bench JSON, emit JSONL. | | QLoRA trainer (PEFT/PyTorch) | tools/surgery/train_code_skeleton_lora.py — train an adapter, save to disk. Once. Not invoked at runtime. | | Merge + repack | tools/surgery/merge_code_skeleton_lora.py — produce a fresh .planck pack. After this step Python is done. | | Probes / one-shot diagnostics | tools/surgery/identity_probe.py, _diagnose_memory.py — read state, print report, exit. |

Each of those is a disposable capsule. It runs to completion, drops a non-Python artefact (.planck, .jsonl, .md, .json), and is gone. The artefact crosses the glass into the C++ runtime; the Python process does not.

Output contract — what crosses the glass

The only legal outputs of a Python surgery capsule are:

  1. A .planck pack consumed by OrganManager via mmap (build/planck7b_tool produces the pack from a merged HF dir).
  2. A JSONL dataset under data/organ_surgery/<organ>/poison_train.jsonl (input to the next surgery, never read at runtime).
  3. A report under reports/ (or its mirror in /mnt/c/Users/pc/Desktop/folder/reports/) that humans read.
  4. A scoreboard / memory update noting the surgery happened.

If a Python tool wants to ship anything else into the live runtime — a .so, a daemon, a sidecar HTTP server, a pickle — that is a violation of this doctrine and must be rewritten in C++ before it is allowed near production code.

How this maps to BD6

The BD6 pass that closed 2026-05-01 followed the contract exactly:

bench failures (C++ runtime → reports/MBPP_HE_3MODE_V1.json)
  → tools/surgery/bench_to_poison_dataset.py            [Python]
    → data/organ_surgery/phys05_code_skeleton/poison_train.jsonl
      → tools/surgery/train_code_skeleton_lora.py       [Python, QLoRA, GPU]
        → tools/surgery/output/code_skeleton_lora/      [PEFT adapter on disk]
          → tools/surgery/merge_code_skeleton_lora.py   [Python, merge + planck7b_tool]
            → physarum05b_code_skeleton.planck          [BF16 pack — the artefact]
              → src/organs/organ_manager.cpp PHYS05_PACK retargeted
                → make -j4
                  → C++ runtime mmaps the new pack at boot
                    → Mode-B re-bench (NO_7B_FALLBACK=1, organ-only)
                      → reports/MBPP_HE_3MODE_V1.json overwritten
                        → reports/BD6_POST_SURGERY_DELTA.md

After the merge step, Python exits. The runtime does not import torch / peft / transformers. It mmaps the BF16 weights, runs them on the existing CUDA Q4 / DP4A path, and emits a DAG envelope. No Python in the request path, ever.

How to keep this doctrine alive

The runtime is a body. Python is a scalpel. After the cut, the scalpel is washed and put back in the drawer.