Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
15 lines
691 B
Python
15 lines
691 B
Python
#!/usr/bin/env python3
|
|
"""Put chain_window.ptx back to its unsealed placeholder state (seal_pins.py refuses to overwrite a pinned PTX)."""
|
|
import re
|
|
import sys
|
|
|
|
ptx = "crates/cuda-driver/src/chain_window.ptx"
|
|
rs = "crates/cuda-driver/src/original_verify_window_chain.rs"
|
|
with open(ptx, "w", newline="\n") as f:
|
|
f.write("// UNSEALED placeholder: chain_window.ptx (compile_assets.py / seal_pins.py install the real PTX)\n")
|
|
s = open(rs, newline="").read()
|
|
s2, n = re.subn(r'(name: "chain_window\.ptx",\n ptx: [^\n]*\n sha: )\[[^\]]*\]', lambda m: m.group(1) + "[0; 32]", s, count=1)
|
|
if n != 1:
|
|
sys.exit("reset_chain_pin: CHAIN.sha not found")
|
|
open(rs, "w", newline="").write(s2)
|