"""Full installed MTPLX forward oracle; run only under test-supervisor. Uses the exact DS4Server native canary entry point from a linked bridge dylib. Diagnostic, not a clean generation benchmark: optional original AR to EOS. """ import ctypes import argparse import hashlib import json import os from pathlib import Path import sys import threading import time def ar_oracle(model, tokenizer, ids, root, set_phase): """Actual _prefill and generate_ar, natural EOS, no tools or downloads.""" import mlx.core as mx import numpy as np from mtplx.runtime import MTPLXRuntime from mtplx.sampling import SamplerConfig from mtplx.generation import (_prefill, generate_ar, _final_logits_prefill_enabled, _sustained_prefill_enabled, _prefill_chunk_size) rt = MTPLXRuntime(model, tokenizer, root, False, None) def fingerprint(a): values = np.asarray(a.astype(mx.float32)).astype('