Audio8-ASR-Infinite-Compressed / sources /scripts /audit_gpu_caption_cross_reset_v1.py
Reza2kn's picture
Reduce MLX cache-rebase allocation and report sustained GPU streaming
fddfb10 verified
Raw History Blame Contribute Delete
2.22 kB
"""Supplement GPU latency with ASR session boundaries, preserving the original score."""
from pathlib import Path
import argparse
import json
from verify_mlx_q3_memory_regression_v1 import timing_audit, sha
def main():
p = argparse.ArgumentParser(description=__doc__)
p.add_argument('--directory', type=Path, required=True)
args = p.parse_args()
root = args.directory
output = root / 'causal-alignment-audit.json'
assert not output.exists()
report = json.loads((root / 'run.json').read_text())
assert report['status'] == 'complete'
raw = root / 'run.jsonl'
obs = root / 'run.observed.jsonl'
assert sha(raw) == report['logs']['raw']['sha256']
assert sha(obs) == report['logs']['observed']['sha256']
rows = [json.loads(line) for line in raw.open()]
observations = [json.loads(line) for line in obs.open()]
# Derived times use the same recorded origin as the unchanged primary score.
for row, receipt in zip(rows, observations, strict=True):
assert row['kind'] == receipt['kind'] and row.get('index') == receipt['index']
receipt['received_seconds_since_feeder_start'] = (
receipt['received_monotonic_seconds'] - report['feeder']['feeder_started_monotonic'])
audit = timing_audit(dict(score=report['caption_score']), rows, observations)
result = dict(status='supplementary_audit_complete', audit=audit,
original_counts=report['caption_score']['counts'],
original_alignment_timing=report['caption_score']['aligned_word_timing'],
production_ready=False, whole_release_pass=False, not_a_replacement_score=True,
method='Textual matches wholly outside the emitting ASR session cannot identify the spoken word for latency. They remain unresolved recognition evidence, never zero-latency successes. Original global score and latency are retained.',
inputs={str(path): sha(path) for path in (root / 'run.json', raw, obs, Path(__file__),
Path(__file__).with_name('verify_mlx_q3_memory_regression_v1.py'))})
output.write_text(json.dumps(result, indent=2) + '\n')
print(json.dumps(audit))
if __name__ == '__main__':
main()