STRA-256's thresholds schema names the source S3.7; rename the enum value from S3.7_FILE in schema.json, the test and the countable-without-summary fixture. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
288 lines
15 KiB
JSON
288 lines
15 KiB
JSON
{
|
|
"$comment": "END_TO_END evidence record, schema v1 (STRA-246, S0.1). One record = one run of one arm. Interpreted by validate.py (hand-written, stdlib only): supported keywords are type, required, properties, additionalProperties (false only), enum, const, pattern, minLength, minimum, exclusiveMinimum, maximum, minItems, items, anyOf and $ref to #/definitions/<name>. Cross-field rules are listed in 'rules' and implemented in validate.py. No statistics are stored per record (mean, median, percentiles and CI belong to STRA-290). COMPONENT levels are STRA-287; 'countable' is derived by STRA-312, the validator only rejects countable=true without the power summary or under BOOTSTRAP thresholds.",
|
|
"schema_version": "1",
|
|
"level": "END_TO_END",
|
|
"constants": {
|
|
"context_tokens_256k": 262144,
|
|
"min_max_prompt_tokens_256k": 200000,
|
|
"ours_cpu_line_regex": "^leleka-serve cpu: ",
|
|
"bare_cpu_line_regex": "^(leleka-serve )?cpu:",
|
|
"min_negative_cases": 17
|
|
},
|
|
"rules": [
|
|
{"id": "RULE_256K_CONTEXT", "text": "configuration.context_tokens == context_tokens_256k"},
|
|
{"id": "RULE_256K_PROMPT", "text": "max(metrics.turns[].prompt_tokens) >= min_max_prompt_tokens_256k"},
|
|
{"id": "RULE_TURN1_TOKENS", "text": "workload.turn1_tokens == metrics.turns[0].prompt_tokens"},
|
|
{"id": "RULE_TURN_ORDER", "text": "turn numbers are 1..n in order; cached_tokens <= prompt_tokens"},
|
|
{"id": "RULE_POSITION", "text": "position 1 has predecessor 'none'; later positions name another arm"},
|
|
{"id": "RULE_OBSERVED_BUILD", "text": "ours_build_id_observed is an object for arm ours and null for vanilla arms"},
|
|
{"id": "RULE_OURS_CPU_LINE", "text": "ours: kernel_lines holds at least one 'leleka-serve cpu: ' line"},
|
|
{"id": "RULE_OURS_NO_VANILLA_BLOCK", "text": "ours: vanilla_cpu_family and vanilla_noskip_environment absent"},
|
|
{"id": "RULE_VANILLA_CLAIMS_CPU", "text": "vanilla: kernel_lines empty or absent, no printed line starting 'cpu:'"},
|
|
{"id": "RULE_VANILLA_BLOCK", "text": "vanilla: vanilla_cpu_family present"},
|
|
{"id": "RULE_NOSKIP_ENV", "text": "vanilla_noskip: vanilla_noskip_environment present (other arms: absent); equals the --row-b-env list when given"},
|
|
{"id": "RULE_ATTESTATION", "text": "owner_attestation.present true needs identifier and time_utc; false needs both null"},
|
|
{"id": "RULE_POWER_SUMMARY_ORDER", "text": "power_sample_summary: min_w <= mean_w <= max_w"},
|
|
{"id": "RULE_POWER_LIMIT_CHANGED", "text": "power_limit_changed == (start limit != end limit)"},
|
|
{"id": "RULE_COUNTABLE_POWER_SUMMARY", "text": "countable true needs power_sample_summary"},
|
|
{"id": "RULE_COUNTABLE_BOOTSTRAP", "text": "countable true is rejected under thresholds_source BOOTSTRAP"},
|
|
{"id": "SERIES_*", "text": "bundle/merge: one series_id, one schedule_sha256, one ours_build_id_frozen, one cache state (WARM and COLD never pooled), no repeated (block, arm)"}
|
|
],
|
|
"definitions": {
|
|
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
|
"commit": {"type": "string", "pattern": "^[0-9a-f]{7,40}$"},
|
|
"text": {"type": "string", "minLength": 1},
|
|
"utc": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"},
|
|
"file_name": {"type": "string", "pattern": "^[^/\\\\]+$"},
|
|
"arm_name": {"type": "string", "enum": ["ours", "vanilla_default", "vanilla_noskip"]},
|
|
"nonneg_int": {"type": "integer", "minimum": 0},
|
|
"pos_int": {"type": "integer", "minimum": 1},
|
|
"pos_number": {"type": "number", "exclusiveMinimum": 0},
|
|
"nonneg_number": {"type": "number", "minimum": 0},
|
|
"fraction": {"type": "number", "minimum": 0, "maximum": 1},
|
|
"nullable_fraction": {"anyOf": [{"$ref": "#/definitions/fraction"}, {"type": "null"}]},
|
|
"string_list": {"type": "array", "items": {"$ref": "#/definitions/text"}},
|
|
"env_entry": {"type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*=.*$"},
|
|
"build_id": {
|
|
"type": "object",
|
|
"required": ["commit", "target_triple", "cargo_features", "profile_value_sha256"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"commit": {"$ref": "#/definitions/commit"},
|
|
"target_triple": {"type": "string", "pattern": "^[a-z0-9_]+(-[a-z0-9_.]+){2,3}$"},
|
|
"cargo_features": {"$ref": "#/definitions/string_list"},
|
|
"profile_value_sha256": {"$ref": "#/definitions/sha256"}
|
|
}
|
|
},
|
|
"turn": {
|
|
"type": "object",
|
|
"required": ["turn", "prompt_tokens", "cached_tokens", "output_tokens", "ttft_s", "prefill_tok_s", "decode_tok_s", "wall_s", "prompt_sha256", "reply_sha256"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"turn": {"$ref": "#/definitions/pos_int"},
|
|
"prompt_tokens": {"$ref": "#/definitions/pos_int"},
|
|
"cached_tokens": {"$ref": "#/definitions/nonneg_int"},
|
|
"output_tokens": {"$ref": "#/definitions/nonneg_int"},
|
|
"ttft_s": {"$ref": "#/definitions/pos_number"},
|
|
"prefill_tok_s": {"$ref": "#/definitions/pos_number"},
|
|
"decode_tok_s": {"anyOf": [{"$ref": "#/definitions/pos_number"}, {"type": "null"}]},
|
|
"wall_s": {"$ref": "#/definitions/pos_number"},
|
|
"prompt_sha256": {"$ref": "#/definitions/sha256"},
|
|
"reply_sha256": {"$ref": "#/definitions/sha256"}
|
|
}
|
|
},
|
|
"power_sample_summary": {
|
|
"type": "object",
|
|
"required": ["min_w", "max_w", "mean_w", "gap_count", "series_sha256", "power_max_limit_w", "power_limit_changed", "power_limit_source"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"min_w": {"$ref": "#/definitions/nonneg_number"},
|
|
"max_w": {"$ref": "#/definitions/nonneg_number"},
|
|
"mean_w": {"$ref": "#/definitions/nonneg_number"},
|
|
"gap_count": {"$ref": "#/definitions/nonneg_int"},
|
|
"series_sha256": {"$ref": "#/definitions/sha256"},
|
|
"power_max_limit_w": {"$ref": "#/definitions/pos_number"},
|
|
"power_limit_changed": {"type": "boolean"},
|
|
"power_limit_source": {"type": "string", "enum": ["enforced.power.limit", "power.limit"]}
|
|
}
|
|
},
|
|
"vanilla_cpu_family": {
|
|
"type": "object",
|
|
"required": ["printed", "reading_rule", "control", "predicate", "binary_identity"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"printed": {"anyOf": [{"$ref": "#/definitions/string_list"}, {"type": "string", "const": "none printed"}]},
|
|
"reading_rule": {"$ref": "#/definitions/text"},
|
|
"control": {
|
|
"type": "object",
|
|
"required": ["env", "printed"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"env": {"$ref": "#/definitions/env_entry"},
|
|
"printed": {"anyOf": [{"$ref": "#/definitions/string_list"}, {"type": "string", "const": "none printed"}]}
|
|
}
|
|
},
|
|
"predicate": {
|
|
"anyOf": [
|
|
{"type": "object", "required": ["tool", "output"], "additionalProperties": false, "properties": {"tool": {"$ref": "#/definitions/text"}, "output": {"$ref": "#/definitions/text"}}},
|
|
{"type": "string", "pattern": "^unavailable: .+"}
|
|
]
|
|
},
|
|
"binary_identity": {
|
|
"type": "object",
|
|
"required": ["engine_version", "sha256"],
|
|
"additionalProperties": false,
|
|
"properties": {"engine_version": {"$ref": "#/definitions/text"}, "sha256": {"$ref": "#/definitions/sha256"}}
|
|
}
|
|
}
|
|
},
|
|
"quality": {
|
|
"type": "object",
|
|
"required": ["verdict", "tolerance", "basis", "baseline", "tool_call_integrity"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"verdict": {"$ref": "#/definitions/text"},
|
|
"tolerance": {"anyOf": [{"type": "number"}, {"$ref": "#/definitions/text"}]},
|
|
"basis": {"$ref": "#/definitions/text"},
|
|
"baseline": {"$ref": "#/definitions/text"},
|
|
"tool_call_integrity": {"anyOf": [{"$ref": "#/definitions/text"}, {"type": "object"}, {"type": "boolean"}]},
|
|
"experimental": {"type": "boolean"}
|
|
}
|
|
}
|
|
},
|
|
"root": {
|
|
"type": "object",
|
|
"required": [
|
|
"schema_version", "level", "arm_identity", "ours_build_id_observed", "ours_build_id_frozen",
|
|
"countable", "invalid_reasons", "thresholds_source", "thresholds_sha256",
|
|
"workload", "cache", "hardware", "software", "model", "configuration", "metrics", "quality"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"schema_version": {"type": "string", "const": "1"},
|
|
"level": {"type": "string", "const": "END_TO_END"},
|
|
"synthetic": {"type": "boolean"},
|
|
"arm_identity": {
|
|
"type": "object",
|
|
"required": ["arm", "series_id", "schedule_sha256", "block", "position", "predecessor_arm", "pair_id", "h0_id"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"arm": {"$ref": "#/definitions/arm_name"},
|
|
"series_id": {"$ref": "#/definitions/text"},
|
|
"schedule_sha256": {"$ref": "#/definitions/sha256"},
|
|
"block": {"$ref": "#/definitions/pos_int"},
|
|
"position": {"type": "integer", "minimum": 1, "maximum": 3},
|
|
"predecessor_arm": {"type": "string", "enum": ["none", "ours", "vanilla_default", "vanilla_noskip"]},
|
|
"pair_id": {"$ref": "#/definitions/text"},
|
|
"h0_id": {"$ref": "#/definitions/text"}
|
|
}
|
|
},
|
|
"ours_build_id_observed": {"anyOf": [{"$ref": "#/definitions/build_id"}, {"type": "null"}]},
|
|
"ours_build_id_frozen": {"$ref": "#/definitions/build_id"},
|
|
"countable": {"type": "boolean"},
|
|
"invalid_reasons": {"$ref": "#/definitions/string_list"},
|
|
"power_sample_summary": {"$ref": "#/definitions/power_sample_summary"},
|
|
"thresholds_source": {"type": "string", "enum": ["BOOTSTRAP", "S3.7"]},
|
|
"thresholds_sha256": {"$ref": "#/definitions/sha256"},
|
|
"workload": {
|
|
"type": "object",
|
|
"required": ["long_session_argv", "source_snapshot_sha256", "turn1_tokens"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"long_session_argv": {"type": "array", "minItems": 1, "items": {"$ref": "#/definitions/text"}},
|
|
"source_snapshot_sha256": {"$ref": "#/definitions/sha256"},
|
|
"turn1_tokens": {"$ref": "#/definitions/pos_int"}
|
|
}
|
|
},
|
|
"cache": {
|
|
"type": "object",
|
|
"required": ["state", "page_cache_residency_before"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"state": {"type": "string", "enum": ["WARM-OS/EMPTY-ENGINE", "COLD"]},
|
|
"page_cache_residency_before": {
|
|
"type": "object",
|
|
"required": ["metric", "value", "unit"],
|
|
"additionalProperties": false,
|
|
"properties": {"metric": {"$ref": "#/definitions/text"}, "value": {"$ref": "#/definitions/nonneg_number"}, "unit": {"$ref": "#/definitions/text"}}
|
|
}
|
|
}
|
|
},
|
|
"hardware": {
|
|
"type": "object",
|
|
"required": [
|
|
"machine_role", "cpu_model", "gpu_name", "os",
|
|
"enforced_power_limit_w_start", "enforced_power_limit_w_end", "power_sample_series_file",
|
|
"owner_attestation", "foreign_load"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"machine_role": {"$ref": "#/definitions/text"},
|
|
"cpu_model": {"$ref": "#/definitions/text"},
|
|
"gpu_name": {"$ref": "#/definitions/text"},
|
|
"os": {"$ref": "#/definitions/text"},
|
|
"enforced_power_limit_w_start": {"$ref": "#/definitions/pos_number"},
|
|
"enforced_power_limit_w_end": {"$ref": "#/definitions/pos_number"},
|
|
"power_sample_series_file": {"$ref": "#/definitions/file_name"},
|
|
"owner_attestation": {
|
|
"type": "object",
|
|
"required": ["present", "identifier", "time_utc"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"present": {"type": "boolean"},
|
|
"identifier": {"anyOf": [{"$ref": "#/definitions/text"}, {"type": "null"}]},
|
|
"time_utc": {"anyOf": [{"$ref": "#/definitions/utc"}, {"type": "null"}]}
|
|
}
|
|
},
|
|
"foreign_load": {
|
|
"type": "object",
|
|
"required": ["samples"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"samples": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["process_name", "cpu_percent_of_core", "duration_s"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"process_name": {"$ref": "#/definitions/text"},
|
|
"cpu_percent_of_core": {"$ref": "#/definitions/nonneg_number"},
|
|
"duration_s": {"$ref": "#/definitions/nonneg_number"}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"software": {
|
|
"type": "object",
|
|
"required": ["driver_version", "cuda_version", "leleka_commit", "strata_upstream_commit"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"driver_version": {"$ref": "#/definitions/text"},
|
|
"cuda_version": {"$ref": "#/definitions/text"},
|
|
"leleka_commit": {"$ref": "#/definitions/commit"},
|
|
"strata_upstream_commit": {"$ref": "#/definitions/commit"}
|
|
}
|
|
},
|
|
"model": {
|
|
"type": "object",
|
|
"required": ["digest", "digest_mapping"],
|
|
"additionalProperties": false,
|
|
"properties": {"digest": {"$ref": "#/definitions/text"}, "digest_mapping": {"$ref": "#/definitions/text"}}
|
|
},
|
|
"configuration": {
|
|
"type": "object",
|
|
"required": ["context_tokens", "kv", "slots", "batch", "speculation"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"context_tokens": {"$ref": "#/definitions/pos_int"},
|
|
"kv": {"$ref": "#/definitions/text"},
|
|
"slots": {"$ref": "#/definitions/pos_int"},
|
|
"batch": {"$ref": "#/definitions/pos_int"},
|
|
"speculation": {"$ref": "#/definitions/text"}
|
|
}
|
|
},
|
|
"metrics": {
|
|
"type": "object",
|
|
"required": ["turns", "wall_s", "wall_norm_s", "draft_acceptance", "expert_cache_hit", "kv_streaming_hit"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"turns": {"type": "array", "minItems": 1, "items": {"$ref": "#/definitions/turn"}},
|
|
"wall_s": {"$ref": "#/definitions/pos_number"},
|
|
"wall_norm_s": {"$ref": "#/definitions/pos_number"},
|
|
"draft_acceptance": {"$ref": "#/definitions/nullable_fraction"},
|
|
"expert_cache_hit": {"$ref": "#/definitions/nullable_fraction"},
|
|
"kv_streaming_hit": {"$ref": "#/definitions/nullable_fraction"}
|
|
}
|
|
},
|
|
"quality": {"$ref": "#/definitions/quality"},
|
|
"kernel_lines": {"type": "array", "items": {"type": "string", "pattern": "^leleka-serve (cpu|gpu): "}},
|
|
"vanilla_cpu_family": {"$ref": "#/definitions/vanilla_cpu_family"},
|
|
"vanilla_noskip_environment": {"type": "array", "minItems": 1, "items": {"$ref": "#/definitions/env_entry"}}
|
|
}
|
|
}
|
|
}
|