Configuration Reference

EngineConfig fields, build-time CMake flags, environment variables, and SIMD diagnostics used by BlazeRules.

BlazeRules configuration has three layers: runtime settings in EngineConfig, build-time CMake options that select features and SIMD kernels, and environment variables used for AWS and s3:// resources.

📘

Defaults prioritize correctness

EngineConfig() requires no overrides. Runtime settings should be changed only after measuring the target workload.

EngineConfig options

EngineConfig is configured by attribute and passed to RuleEngine. The Python binding exposes the fields below.

Batch execution and models

OptionType / valuesDefaultPurpose
batch_sizePositive int10000Preferred row count for batch-oriented entry points and adapters.
parallel_thresholdPositive int1000Minimum row count before parallel evaluation is considered.
eval_thread_countNon-negative int0Evaluation worker count. 0 uses the runtime default.
model_intra_op_threadsPositive int1ONNX Runtime intra-op threads per model session. 1 avoids oversubscription when several engine shards run inference concurrently.
enable_thread_affinityboolFalseEnables best-effort worker affinity on supported platforms.
enable_prefetchboolFalseEnables kernel prefetch hints where implemented.

Result materialization and tracing

OptionType / valuesDefaultPurpose
output_detailCOUNTS, CODES, DECISIONS, BITMASKSBITMASKSSelects aggregate counts, compact row codes, routing results, or routing results plus per-rule masks.
result_buffer_reuseboolTrueReuses eligible result buffers between batches. Retained arrays must be copied before the next evaluation when this option is enabled.
trace_modeTRACE_NONE, TRACE_SAMPLED, TRACE_ALLTRACE_NONEControls explanation/trace generation.
trace_sample_ratefloat from 0 to 10.05Sampling fraction used by TRACE_SAMPLED.
decision_log_pathPath stringEmptyEnables compact NDJSON decision logging when set.
dead_letter_pathPath stringEmptyDestination for malformed records when dead-letter routing is enabled.
max_error_samplesNon-negative int16Maximum ingest error samples retained in each BatchResult.

Ingest and schema policy

OptionType / valuesDefaultPurpose
ingest_error_modeSKIP_AND_COUNT, SKIP_TO_DEAD_LETTER, HARD_FAILSKIP_AND_COUNTSkips malformed records, writes them to the dead-letter sink, or aborts the batch.
type_mismatch_modeNULL_ON_TYPE_ERROR, COERCE, HARD_FAIL_TYPENULL_ON_TYPE_ERRORConverts mismatched values to null, attempts safe coercion, or aborts evaluation.
max_dict_size_per_columnPositive int100000Maximum dictionary cardinality for a dictionary-encoded column. Entity keys are not collapsed into an overflow ID.
arena_size_bytesPositive int8388608Initial per-engine arena capacity in bytes.

Windows and state

OptionType / valuesDefaultPurpose
max_window_entitiesPositive int10000000Maximum tracked entities across window state.
eviction_sweep_interval_minutesPositive int5Interval between expired-state eviction sweeps.

Predicate execution

OptionType / valuesDefaultPurpose
enable_selection_vectorsboolTrueEnables sparse selection-vector execution.
selection_vector_thresholdfloat from 0 to 10.20Selectivity threshold below which selection vectors may be used.
enable_adaptive_predicate_orderingboolTrueAllows predicate ordering to adapt from observed selectivity.
enable_no_validity_fast_pathboolTrueUses specialized kernels when projected columns contain no nulls.
simd_backend_override"auto", "scalar", "neon", "sse2", "avx2", "avx512""auto"Selects runtime dispatch or forces a supported SIMD backend. Unsupported overrides fail with a structured error rather than executing an illegal instruction.
enable_avx512boolFalseAllows AVX-512 selection in automatic mode when the compiled binary, CPU, and operating system support it.

Hot reload

OptionType / valuesDefaultPurpose
hot_reload_poll_secondsPositive int5File polling interval for background rule reload.
hot_reload_validate_conflictsboolTrueRuns conflict analysis before activating a candidate ruleset.
hot_reload_keep_previous_on_failureboolTrueKeeps the active ruleset when candidate loading or validation fails.
🚧

output_detail integer values shifted — reference it by name

OutputDetail.COUNTS and OutputDetail.CODES were added before DECISIONS and BITMASKS in the underlying enum, so the raw integer values shifted: DECISIONS and BITMASKS used to be 0 and 1 and are now 2 and 3. Any config that serialized output_detail as a raw integer instead of the named constant — EngineConfig::OUTPUT_DECISIONS in C++, blazerules.OutputDetail.DECISIONS in Python, or a bare number in a hand-rolled config file — will silently resolve to a different, cheaper output tier after upgrading. Always set output_detail by name, never by number. See Decisions & Scoring for what each tier materializes.

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")
📘

Constructor forms

RuleEngine() uses defaults and infers schema from the first batch. RuleEngine(config) applies runtime settings and still infers schema. RuleEngine(schema, config) binds explicit field types before evaluation. See Data Model & Schema for inference and drift semantics.

Setting these from the CLI

The commonly used runtime options map to blazerules eval flags:

EngineConfig attributeblazerules eval flag
output_detail--output-detail
ingest_error_mode--ingest-error-mode
type_mismatch_mode--type-mismatch-mode
simd_backend_override--simd-backend
batch_size--batch-size
eval_thread_count--threads
decision_log_path--decision-log
dead_letter_path--dead-letter-log

blazerules ... --config config.yaml accepts the supported CLI configuration keys under an engine: block. Explicit flags take precedence. The complete command and value tables are in API & CLI Values.

Build-time CMake options

These options select compiled features and SIMD kernels during CMake configuration. The project defaults enable the complete feature set.

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_IO_S3ONNative Arrow S3 reads with AWS CLI fallback support
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, Protobuf, and S3 sub-options have no effect unless the IO module is built with -DBLAZERULES_IO=ON. Release wheels and default source builds enable the IO module. Python exposes runtime capability checks as has_kafka, has_avro, and has_protobuf. There is no has_s3 attribute; native S3 support is selected at build time and can fall back to the AWS CLI path. See Troubleshooting for connector diagnostics.

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 for rules, lookup CSVs, and ONNX models. Configure the profile, region, and endpoint with environment variables or the equivalent set_aws_profile(), set_aws_region(), and set_aws_endpoint_url() functions.

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 supports S3-compatible endpoints such as MinIO. Credentials belong in the deployment platform's secret mechanism rather than source-controlled files.

SIMD diagnostics

Two read-only helpers report the selected backend and detected CPU features.

import blazerules

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

On Apple Silicon, simd_backend() normally reports neon. On an x86_64 host with AVX2 support, it normally reports avx2. A supported simd_backend_override changes the selected backend.

🚧

AVX-512 auto-selection is still runtime-gated

AVX-512 kernels are compiled in full builds, but runtime selection still checks CPU and OS support. Some server CPUs reduce frequency under wide vectors, which can make AVX-512 slower than AVX2 for mixed rule workloads. Benchmark the production ruleset and target hardware before forcing a backend.

Related documentation


Did this page help you?