--- library_name: pytorch tags: - code-layout - graph-neural-network - linker - research --- # NeuroLD 0.1.0 NeuroCC 0.4.0 compiles source code into machine-code functions. NeuroLD can take supported functions from that compiler and place them in a Linux executable. This model helps NeuroLD choose an order for the functions: it suggests putting closely related functions near each other. The goal is to explore better code layout; a suggested order does not guarantee a faster program. This package contains the trained placement model and a small example for trying it. The model does not compile source code or create an executable by itself. A local test successfully compiled one supported function with NeuroCC 0.4.0 and linked it with NeuroLD. Broader compiler-to-linker support is still being tested, especially for functions with calls or relocations. ## Load and use Install `requirements.txt`, then run from this directory: ```python from model import load_model, predict_order model = load_model(device="cpu") order = predict_order( model, sizes=[64, 96, 80], edges=[[0, 1], [1, 2]], weights=[10.0, 5.0], candidates=1, )[0] print(order.tolist()) # a permutation of [0, 1, 2] ``` In this example, `sizes` are function sizes in bytes, `edges` name pairs of related functions, and `weights` say how strongly each pair is related. The result lists the functions in a suggested order. This standalone example handles 1–24 functions. For larger programs, the full NeuroLD software breaks the graph into smaller groups and checks the suggestions against a deterministic layout method. A suggested order still needs normal linker validation before use. ## Inputs and checkpoint `sizes` are positive byte sizes, `edges` are zero-based directed object pairs, and `weights` are finite nonnegative edge weights. The network uses 16-byte aligned size normalization during the synthetic proxy evaluation. `model.safetensors` contains 59,011 parameters, width 64, three message-passing layers. Source checkpoint SHA-256: `5dd12cc35b98baf7c9b803cbbc2faf0f6bc99c902ef0f9b87b8069d05dadd667`. The safetensors file has its own hash in `SHA256SUMS`. ## Training and evaluation The existing run trained on 192 synthetic graphs, 512 bounded imitation tasks, 4 epochs, with graph sizes [16, 32, 64, 128, 256, 512]. The teacher was deterministic greedy placement plus local search against a weighted-distance proxy. Held-out synthetic families and seeds were evaluated with matched full-program score counts, excluding preprocessing and decoder work. At 512 objects, the mean proxy ratio to identity was 0.073 for neural hierarchy and 0.086 for deterministic hierarchy (6 graphs). These are proxy scores, not measured speedups. On two earlier 514-object compiled fixtures, the neural hierarchical proxy ratio was 0.338 versus 0.368 for deterministic hierarchy. Native timings from that small experiment were noisy; no reliable native speedup claim follows. The broader cache experiment did not yield reliable runtime ranking labels. CUDA and PE native behavior are outside this model card's verification. ## NeuroCC 0.4.0 relationship NeuroLD was checked against the NeuroCC 0.4.0 release at `C:/GitHub/neurocc-scaling/release_0_4_0/neuro-compiler-0.4.0`. In one trusted local test, NeuroCC produced a 344-byte function; NeuroLD placed it in a Linux ELF executable that returned the expected exit code, 42. This verifies that specific supported path. NeuroCC 0.4.0's default function output rejects calls and active relocations, so a general link of arbitrary NeuroCC programs is not yet established. The model reads function sizes and relationships after compilation; it does not read NeuroCC source code. ## Limitations - The model optimizes a synthetic weighted-distance proxy; it is not a runtime predictor. - Host partitioning and deterministic local search are required for larger graphs and robust candidate selection. - The standalone model does not emit ELF, PE, COFF, relocations, or machine code. - Do not execute untrusted binary inputs. Verify exact constraints and independent semantics for any linked output. - No license is asserted here because the supplied NeuroLD tree has no project license file; resolve distribution terms before publishing. ## Reproduce locally To rebuild this model repository from the frozen checkpoint without retraining, run `python tools/package_hf_model.py` from the NeuroLD source tree.