Skip to content

Commit d0bbfd3

Browse files
committed
Write portable gzip headers for profile event tables
Use a neutral OS byte for newly compiled events so content-addressed synthetic exports match across Linux, Windows and supported Python versions. Existing registered event files remain readable. Agent-assisted-by: Codex (implementation and validation) Signed-off-by: David Chen <530634352@qq.com>
1 parent 2241101 commit d0bbfd3

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎docs/examples/dashboard-profile-review.html‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎src/inferrsi/harness/records/profile_timeline.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,12 @@ def overview_name(index: int) -> dict:
302302
payload = json.dumps(full, separators=(",", ":"), ensure_ascii=True, allow_nan=False).encode()
303303
if len(payload) > 128 << 20:
304304
raise ValueError("compiled event table exceeds its limit")
305-
return summary, gzip.compress(payload, compresslevel=3, mtime=0)
305+
# GzipFile writes a neutral OS header on all supported Python versions.
306+
# The digest identifies these exact bytes, including the gzip header.
307+
buffer = io.BytesIO()
308+
with gzip.GzipFile(fileobj=buffer, mode="wb", compresslevel=3, mtime=0) as stream:
309+
stream.write(payload)
310+
return summary, buffer.getvalue()
306311

307312

308313
def _put(path, data):

0 commit comments

Comments
 (0)