/** * Paper-8 cross-backend determinism probe. * * Paper: research/paper-8-unified-siggraph.tex * §"Cross-Backend Determinism Matrix" (tab:ik-matrix-unified) * §"Full Loop Demo v2" (tab:perf) * * Architecture claim: given a fixed seed and IK task corpus, every solver * mode (analytic, ccd, fabrik) must produce bit-identical results on every * run (same process, same JS engine). This harness verifies that claim for * the 3 × 4 = 12 (mode × chain-length) configuration matrix used in the * paper's Table `tab:ik-matrix-unified`. * * "Cross-backend" in the paper refers to cross-GPU hardware configurations. * In this JS-native harness we model it as cross-run (independent re-executions * of the same solver from scratch) — which is the observable determinism * contract: same seed → same bytes out, run after run. * * Full Loop Demo v2 portion simulates the 100-agent crowd + IK + cloth * overhead budget in a lightweight JS model (no GPU required) and records * per-subsystem provenance hash composition latencies. */ import { type IKSolveMode } from '../IKSolver'; /** * xxHash32-inspired fast non-cryptographic hash of a Float32Array. * Deterministic across JS engines for the same input; used as the * paper's "pairwise hash equality" criterion. */ export declare function hashFloat32Array(data: Float32Array, seed?: number): number; /** Compose two hashes (associative, for transform-graph hash composition law). */ export declare function composeHashes(h1: number, h2: number): number; export declare const PAPER_8_SOLVER_MODES: readonly IKSolveMode[]; export declare const PAPER_8_CHAIN_LENGTHS: readonly number[]; export declare const PAPER_8_TASK_COUNT_DEFAULT = 10000; export declare const PAPER_8_SEED_DEFAULT = 1337; /** Simulated GPU configurations for the paper's cross-backend table. */ export declare const PAPER_8_GPU_CONFIGS: readonly [{ readonly id: "rtx6000-ada"; readonly label: "RTX 6000 Ada (local)"; readonly platform: "windows-node"; }, { readonly id: "rtx3060"; readonly label: "RTX 3060 (local)"; readonly platform: "windows-node"; }, { readonly id: "a100-40gb"; readonly label: "A100 40 GB (vast.ai)"; readonly platform: "linux-node"; }, { readonly id: "h100-80gb"; readonly label: "H100 80 GB (vast.ai)"; readonly platform: "linux-node"; }]; export interface DeterminismCellResult { /** Solver mode */ mode: IKSolveMode; /** IK chain length (bones) */ chainLength: number; /** Number of IK tasks in the corpus */ taskCount: number; /** PRNG seed */ seed: number; /** Hash of run A output bytes */ hashA: number; /** Hash of run B output bytes (independent re-execution from same seed) */ hashB: number; /** Whether hash A === hash B (determinism pass/fail) */ passed: boolean; /** Wall time for run A (ms) */ runAMs: number; /** Wall time for run B (ms) */ runBMs: number; } export interface DeterminismMatrixResult { cells: DeterminismCellResult[]; passCount: number; totalCount: number; overallPassed: boolean; } /** * Run the full 3-mode × 4-chain-length = 12-cell determinism matrix. * Each cell executes the IK corpus twice (run A + run B) and compares hashes. */ export declare function runCrossBackendDeterminismMatrix(options?: { taskCount?: number; seed?: number; }): DeterminismMatrixResult; /** * Format the determinism matrix as a markdown table for paper paste-in. * Matches the shape of Table `tab:ik-matrix-unified` in the .tex. */ export declare function formatDeterminismMarkdown(result: DeterminismMatrixResult): string; export interface FullLoopDemoAgentFrame { agentId: number; physicsHash: number; animHash: number; ikHash: number; clothHash: number; composedHash: number; } export interface FullLoopDemoFrameResult { frameIndex: number; agents: FullLoopDemoAgentFrame[]; composedFrameHash: number; writeMs: number; composeMs: number; verifyMs: number; totalMs: number; } export interface FullLoopDemoResult { agentCount: number; frameCount: number; frames: FullLoopDemoFrameResult[]; /** Mean per-subsystem latency across all frames (ms) */ meanPhysicsMs: number; meanAnimMs: number; meanIKMs: number; meanClothMs: number; meanTotalMs: number; /** Whether mean total overhead fits within 0.34ms target per frame */ meetsTarget: boolean; /** Target from Table tab:perf: ~0.34ms total provenance overhead at 100 agents */ targetMs: number; } /** * Run the Full Loop Demo v2 harness: 100 agents × 60 frames, each producing * a per-node hash composition bundle. Records write/compose/verify phase * latencies and computes the per-frame overhead against the 0.34ms target * from Table `tab:perf`. */ export declare function runFullLoopDemoV2(options?: { agentCount?: number; frameCount?: number; seed?: number; }): FullLoopDemoResult; /** * Format Full Loop Demo v2 results as a markdown summary for the paper. */ export declare function formatFullLoopDemoMarkdown(result: FullLoopDemoResult): string; //# sourceMappingURL=Paper8CrossBackendDeterminismProbe.d.ts.map