fraudtwin.benchmark#
Benchmark packs and reproducible suite execution.
Status: Experimental
Classes#
|
Framework-neutral adapter implemented by optional model environments. |
|
Strict command-level benchmark request. |
|
Paths and stable metadata emitted by one benchmark invocation. |
|
Read-only paths and metadata supplied to an external model runner. |
|
Immutable, distributable M21 benchmark definition. |
|
Framework and input lineage declared by an external model runner. |
Functions#
|
Build and validate one standard suite without mutating global config. |
|
Return all bundled public packs in stable identity order. |
|
Resolve an exact or unambiguous major/minor public-pack reference. |
|
Generate and evaluate one or every standard benchmark suite. |
|
Run one immutable bundled M21 pack and verify its frozen outputs. |
|
Verify an existing public benchmark artifact without regenerating it. |
Constants and protocols#
Name |
Reference |
|---|---|
|
|
|
|
Detailed API#
Reproducible fraud stress benchmark orchestration.
The benchmark layer owns suite composition and reporting. It deliberately delegates generation to the existing deterministic engines and model scoring to the M19 prediction contract.
- class fraudtwin.benchmark.BenchmarkModelRunner(*args, **kwargs)[source][source]
Bases:
ProtocolFramework-neutral adapter implemented by optional model environments.
- class fraudtwin.benchmark.BenchmarkRequest(**data)[source][source]
Bases:
BaseModelStrict command-level benchmark request.
- Parameters:
suite (Literal['baseline', 'temporal', 'boundary', 'camouflage', 'graph', 'observability', 'calibrated', 'mixed', 'all'])
difficulty (int)
seed (int)
output_dir (Path)
models (tuple[str, ...])
runners (tuple[str, ...])
calibration_profile (Path | None)
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class fraudtwin.benchmark.BenchmarkResult(benchmark_id, root, manifest_path, results_path, descriptors_path, results)[source][source]
Bases:
objectPaths and stable metadata emitted by one benchmark invocation.
- Parameters:
benchmark_id (str)
root (Path)
manifest_path (Path)
results_path (Path)
descriptors_path (Path)
results (tuple[dict[str, Any], ...])
- class fraudtwin.benchmark.BenchmarkRunnerInput(suite, difficulty, dataset_path, run_dir, manifest)[source][source]
Bases:
objectRead-only paths and metadata supplied to an external model runner.
- Parameters:
suite (str)
difficulty (int)
dataset_path (Path)
run_dir (Path)
manifest (dict[str, Any])
- class fraudtwin.benchmark.PublicBenchmarkPack(**data)[source][source]
Bases:
BaseModelImmutable, distributable M21 benchmark definition.
- Parameters:
id (Annotated[str, _PydanticGeneralMetadata(pattern='^FT-B0[1-8]-[A-Z]+$')])
version (Annotated[str, _PydanticGeneralMetadata(pattern='^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$')])
suite (Literal['baseline', 'temporal', 'boundary', 'camouflage', 'graph', 'observability', 'calibrated', 'mixed'])
generator_compatibility (Annotated[str, _PydanticGeneralMetadata(pattern='^>=\\d+\\.\\d+\\.\\d+,<\\d+\\.\\d+\\.\\d+$')])
seed (Annotated[int, Ge(ge=0)])
seed_tree_version (Annotated[str, MinLen(min_length=1)])
difficulty (Annotated[int, Ge(ge=1), Le(le=10)])
simulation_start (datetime)
simulation_end (datetime)
split_boundaries (dict[str, datetime])
scenario_definitions (dict[str, Any])
stress_parameters (dict[str, Any])
label_observation_policy (dict[str, Any])
calibration (dict[str, Any] | None)
metric_definitions (dict[str, Any])
resolved_configuration_hash (Annotated[str, MinLen(min_length=1)])
expected_descriptors (dict[str, Any])
expected_fingerprints (dict[str, str])
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class fraudtwin.benchmark.RunnerMetadata(**data)[source][source]
Bases:
BaseModelFramework and input lineage declared by an external model runner.
- Parameters:
model_id (str)
framework (str)
framework_version (str)
required_inputs (tuple[str, ...])
parameters (dict[str, Any])
artifact_checksums (dict[str, str])
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- fraudtwin.benchmark.build_suite_config(suite, *, difficulty, seed, calibration_profile=None)[source][source]
Build and validate one standard suite without mutating global config.
- Return type:
SimulationRunConfig- Parameters:
suite (str)
difficulty (int)
seed (int)
calibration_profile (Path | None)
- fraudtwin.benchmark.list_public_packs()[source][source]
Return all bundled public packs in stable identity order.
- Return type:
tuple[PublicBenchmarkPack,...]
- fraudtwin.benchmark.load_public_pack(reference)[source][source]
Resolve an exact or unambiguous major/minor public-pack reference.
- Return type:
- Parameters:
reference (str)
- fraudtwin.benchmark.run_public_benchmark(reference, *, output_dir=Path('runs/benchmarks'), models=('deterministic_heuristic',), runners=())[source][source]
Run one immutable bundled M21 pack and verify its frozen outputs.
- Return type:
BenchmarkResult- Parameters:
reference (str)
output_dir (Path)
models (tuple[str, ...])
runners (tuple[str, ...])