1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
//! Pure Rust reference interpreter for vyre IR programs.
//!
//! This module is the executable specification for IR semantics. It is
//! intentionally slow and direct: every current IR expression and node variant
//! has a named evaluator function.
extern crate vyre_foundation as vyre;
/// Dual-reference trait and registry types.
/// Canonical dual implementations and reference evaluators.
/// Runtime value representation for interpreter inputs and outputs.
/// Atomic operation reference implementations.
/// CPU operation traits used by concrete reference implementations.
/// Registry-driven dispatch entry point (B-B4).
///
/// Routes an op id through the global `DialectRegistry` and invokes
/// the registered `cpu_ref` function. Complements the execution-tree
/// evaluators by giving external dialect crates a zero-patch path to run on
/// the reference interpreter.
/// Canonical reference execution tree.
/// Flat byte adapter used by [`crate::cpu_op::CpuOp`].
/// IEEE 754 strict floating-point utilities.
/// Subgroup simulator for lane-collective Cat-C ops.
/// Workgroup simulation: invocation IDs, shared memory.
/// Test-only entry point that runs the hashmap interpreter over a Program.
pub use eval_hashmap_reference;
/// Execute a vyre Program on the pure Rust reference interpreter.
pub use ;
/// Resolve an operation ID to its two independently-written references.
///
/// # Examples
///
/// ```
/// use vyre_reference::{dual_impls, resolve_dual};
///
/// let (reference_a, reference_b) =
/// resolve_dual(dual_impls::bitwise::xor::OP_ID).expect("Fix: xor dual refs must be registered; restore this invariant before continuing.");
///
/// let input = [0b1010_1010_u8, 0b0101_0101];
/// assert_eq!(reference_a(&input), reference_b(&input));
/// ```
/// Return the complete list of operation IDs that have dual references registered.
///
/// This is the canonical enumeration used by the differential fuzzing gate.
/// Every new dual-reference pair MUST add its OP_ID here.
/// The architecture of the `OpEntry` registry.
///
/// We are forced to split the global primitive registries into three separate
/// buckets (Unary, Binary, Variadic) instead of a single unified registry.
///
/// This split is required because of Rust's trait object lifetime limits.
/// When storing function pointers that take references (e.g., `&'a Node<'a>`),
/// higher-ranked trait bounds (HRTB, `for<'a>`) fail to unify on function
/// pointers with heterogeneous arities. A single registry `fn(&[Node])` slice
/// signature would force heap allocation for binary/unary nodes to fit the slice,
/// destroying the zero-allocation invariant of the reference interpreter.
///
/// Thus, we split by arity to allow zero-cost static dispatch.