>[!warning]
>This content has not been peer reviewed.
# Material layer — Code
The **unified chain** (RST fidelity and workload across scale parts) is implemented in the Reality Engine folder so that one runner can run both baseline and unified modes.
## Script and location
- **Unified chain script:** `../Reality Engine/rst_reality_engine_unified_chain.py`. Can be run standalone: `python rst_reality_engine_unified_chain.py [--config config/default.json] [--output-dir .]`
- **Invocation via runner:** `python run_reality_engine.py unified` (from the Reality Engine folder) runs the unified chain using config `unified_chain` (parts list, eta0, translation_rule) and writes to config `output_dir`.
## Logic
- **Scale registry (in code):** Ordered list of (part name, typical L in m): planck, quark, hadron, atom, molecule (same as [[../../../../expanded theory/parts/Scale registry]]).
- **Translation rule (Option C):** \(\eta_{j+1} = \eta_j \cdot (1 + \alpha \log_{10}(L_{j+1}/L_j))\). At each scale \(j\): \(N_j = \mathrm{const}\), \(\Omega_j = \eta_j N_j\), \(W_j = \mathrm{triangle\_W}(\Omega_j, N_j, n)\), \(\mu_j = \Omega_j/W_j\).
- **Outputs:** `reality_engine_unified_chain.csv` (columns: part, L, eta, I, N, Omega, W, mu, eta_source) and `reality_engine_unified_chain.png` (μ vs \(\log_{10}(L)\) with part labels). The figure demonstrates **layer-to-layer translation**: one allocation equation and one translation rule produce a single fidelity curve across parts/scales.
## Links
- **Application:** [[Material layer (RST)]]
- **Results:** [[Material layer Results]]
- **Parts / Scale registry:** [[../../../../expanded theory/parts/Parts index]], [[../../../../expanded theory/parts/Scale registry]]
- **Reality Engine:** [[../Reality Engine/Reality Engine (RST)]]