Configuration Reference

Every EngineConfig option, build-time CMake flag, and environment variable used to tune the BlazeRules engine.

This page is the reference for tuning the engine at three layers: runtime (an EngineConfig you pass when constructing a RuleEngine), build time (CMake options that decide which features and SIMD kernels are compiled in), and environment (variables that point the engine at AWS for s3:// reads).

📘

Defaults are production-safe

Every option below has a default chosen for correctness over raw speed. You can run BlazeRules with EngineConfig() and no overrides; tune only the values you have a measured reason to change.

EngineConfig options

EngineConfig is constructed empty and configured by attribute, then handed to a RuleEngine. All five options below are surfaced on the config object.

OptionValuesDefaultWhat it controls
output_detailOutputDetail.DECISIONS, OutputDetail.BITMASKSOutputDetail.DECISIONSHow much per-record detail the engine emits. DECISIONS returns decisions, scores, risk bands, winning rules, and match counts — enough to route. BITMASKS additionally materializes a per-rule match bitmask per record; only request it when downstream code needs to know exactly which rules fired.
ingest_error_modeIngestErrorMode.SKIP_AND_COUNT, IngestErrorMode.SKIP_TO_DEAD_LETTER, IngestErrorMode.HARD_FAILIngestErrorMode.SKIP_AND_COUNTWhat happens when a record cannot be ingested (malformed JSON, unparseable row). SKIP_AND_COUNT drops the record and increments counters. SKIP_TO_DEAD_LETTER routes it aside for inspection. HARD_FAIL aborts the batch.
type_mismatch_modeTypeMismatchMode.NULL_ON_TYPE_ERROR, TypeMismatchMode.COERCE, TypeMismatchMode.HARD_FAIL_TYPETypeMismatchMode.NULL_ON_TYPE_ERRORWhat happens when a field value does not match the bound/inferred type. NULL_ON_TYPE_ERROR treats the value as null for that field. COERCE attempts a safe conversion. HARD_FAIL_TYPE aborts on the first mismatch.
simd_backend_override"auto", "scalar", "neon", "sse2", "avx2", "avx512""auto"Forces a specific SIMD kernel family instead of runtime CPU detection. "auto" selects the best available backend for the current CPU. The other values pin a backend — useful for reproducible benchmarks or working around a CPU quirk. Pinning a backend the CPU does not support falls back appropriately; measure before pinning.
enable_avx512True, FalseFalseWhether AVX-512 kernels are eligible during "auto" selection. Off by default because some server CPUs reduce clock frequency under wide vectors. See the callout below.

Constructing an engine with a config

   import blazerules

   config = blazerules.EngineConfig()
   config.output_detail = blazerules.OutputDetail.DECISIONS
   config.ingest_error_mode = blazerules.IngestErrorMode.SKIP_AND_COUNT
   config.type_mismatch_mode = blazerules.TypeMismatchMode.NULL_ON_TYPE_ERROR
   config.simd_backend_override = "auto"
   config.enable_avx512 = False

   engine = blazerules.RuleEngine(config)
   engine.load_rules("rules.yaml")
📘

Three constructors

RuleEngine() uses defaults and infers schema from the first batch. RuleEngine(config) applies your tuning but still infers schema. RuleEngine(schema, config) binds an explicit schema up front — use it when you want deterministic types instead of inference. See Troubleshooting for why explicit schema avoids the "everything inferred as INT32" surprise.

Build-time CMake options

These options are set when you configure the build. They decide which features (ONNX, IO connectors, dashboard/agent) and which SIMD kernels are compiled into the library. Defaults are full-feature.

OptionDefaultPurpose
BLAZERULES_ENABLE_ONNXONEnables model_score rules and register_model()
BLAZERULES_IOONBuilds blazerules_io connectors/decoders
BLAZERULES_IO_KAFKAONKafka source/sink inside blazerules_io
BLAZERULES_IO_AVROONAvro binary decoder
BLAZERULES_IO_PROTOBUFONProtobuf descriptor decoder
BLAZERULES_DASHBOARDONLocal read-only dashboard executable
BLAZERULES_AGENTONLocal multi-input log/HTTP/file agent
BLAZERULES_NATIVE_TUNEONLocal -march=native style tuning
BLAZERULES_X86_AVX2ONBuilds runtime-dispatched AVX2 kernels on x86_64
BLAZERULES_X86_AVX512ONBuilds optional AVX-512 kernels on x86_64
🚧

BLAZERULES_IO_KAFKA only matters when BLAZERULES_IO=ON

The Kafka, Avro, and Protobuf sub-options have no effect unless the IO module is built with -DBLAZERULES_IO=ON. The release wheel and default source build enable it. If a connector or decoder is missing at runtime, check both flags. See Troubleshooting for the has_kafka / has_avro / has_protobuf capability checks.

Portable Linux, Windows, and cloud builds do not compile generic code with global AVX flags. ISA-specific files are compiled separately and selected at runtime. For ready-made build shapes per platform, use the presets documented in Deployment.

Environment variables

The engine reads exact-object s3://bucket/key URIs (rules, lookup CSVs, ONNX models) through the AWS CLI cache path. You can point it at a profile, region, and endpoint with environment variables — the equivalent of set_aws_profile() / set_aws_region() / set_aws_endpoint_url().

export BLAZERULES_AWS_PROFILE=personal
export BLAZERULES_AWS_REGION=us-east-1
export BLAZERULES_AWS_ENDPOINT_URL=http://127.0.0.1:9000

BLAZERULES_AWS_ENDPOINT_URL is useful for S3-compatible stores (for example, a local MinIO). When deploying, supply these through your platform's secret mechanism rather than committing them — see Deployment.

SIMD diagnostics

Two read-only helpers report what backend the engine selected and what the CPU advertises. Use them when filing an issue or verifying a build behaves as expected on a given host.

import blazerules

print(blazerules.simd_backend())          # e.g. "neon" on an Apple M1
print(blazerules.cpu_features_summary())  # human-readable CPU feature list

On the reference machine (Apple M1) simd_backend() reports neon. On a cloud x86_64 host with AVX2 compiled in, it typically reports avx2. If you pinned simd_backend_override, this reflects the pinned value where supported.

🚧

AVX-512 auto-selection is still runtime-gated

AVX-512 kernels are compiled in full builds, but the engine still checks CPU and OS support before selecting them. Some server CPUs reduce frequency under wide vectors, which can make AVX-512 slower than AVX2 for a mixed rule workload. Benchmark your own ruleset on your own hardware before forcing it.

Where to go next