Skip to content

check.compare

← check dialect

Ends a trial by independently invoking target and oracle subjects and checking their explicit typed observations. A single subject is used for both profiles; an optional second subject supplies the oracle implementation. Call parameters configure the target. A distinct ordinary function oracle receives only the shared arguments; another product-shaped oracle receives the same call parameters as the target.

Operation contract

Property Value
Semantic phase —
Traits Terminator, UnknownEffects, HasParent(check.trial), ImplicitTerminator(check.return)

Signature

Kind Name Type Cardinality Description
Operand call_parameters any variadic Kernel workloads or command/pipeline specialization values.
Operand arguments any variadic Runtime subject arguments.
Attribute callee symbol (callable, kernel, command_program, pipeline) required —
Attribute actual_count i64 optional Number of leading comparison-region arguments bound to target results.
Attribute oracle_callee symbol (callable, kernel, command_program, pipeline) optional Optional oracle subject; omission uses the target subject through the oracle profile.
Region comparison region required Explicit expectations and NPY outputs over completed target and oracle values. Outputs over captured values save both realizations; a result binding selects its own realization. Saving a result does not replace its paired expectation. (single block, terminator check.return.)

Examples

check.compare<@logarithm>(%bits) : (i32) -> [actual(%actual: f32), expected(%expected: f32)] {
  check.expect.approximate actual(%actual) expected(%expected) atol(0.0) rtol(1.0e-6) nan(same) : f32, f32
}
check.compare<@logarithm, @logarithm_oracle>(%bits) : (i32) -> [actual(%actual: f32), expected(%expected: f32)] {
  check.expect.approximate actual(%actual) expected(%expected) atol(0.0) rtol(1.0e-6) nan(same) : f32, f32
}
check.compare<@update>(%storage) : (tensor<256xf32>) -> () {
  check.expect.bitwise actual(%storage) expected(%storage) : tensor<256xf32>
}