Every tracked file that can carry a comment (880 of them) now opens with "Author: Guoliang Chen, a Senior Digital Design Engineer" and closes with "Author: Guoliang Chen. Lucisv is made by Guoliang Chen with love, luciochen.com", in the file's own comment syntax. No behaviour change: the diff outside the version bump and changelogs is comment lines only. - tools/stamp_author.py: writes the lines; idempotent, `--check` lists what is missing. Headers go under a shebang and under Markdown front matter. - Left alone: test fixtures, cases and snapshots (byte-exact inputs), JSON and JSONL, logs, images, lockfiles, docs/site/dist (regenerated) and the LICENSE files (already carry the copyright line). - tools/linux_check.sh: --help reads its header from line 3, now that the author line sits under the shebang. - tools/gates.sh green on this tree: 5 545 tests, corpus 814/6 as before. Co-Authored-By: Claude Mythos 5.2 <[email protected]>
25 lines
1.8 KiB
Python
25 lines
1.8 KiB
Python
# Author: Guoliang Chen, a Senior Digital Design Engineer
|
|
|
|
import subprocess,os,json,time,hashlib
|
|
from pathlib import Path
|
|
root=Path('/Users/guoliangchen/repo/verilogrustformatter'); out=Path('/tmp/lucisv-perf-review-20260909'); corpus=Path('/Users/guoliangchen/repo/opentitan')
|
|
old=str(out/'reference/target/release/lucisv-server')
|
|
bins={'0.51.0-reference':old,'0.52.0-review':str(root/'target/release/lucisv-server')}
|
|
def state():
|
|
s=subprocess.check_output(['git','-C',str(corpus),'status','--porcelain'],text=True)
|
|
return s,{p:hashlib.sha256((corpus/p).read_bytes()).hexdigest() for p in ['hw/ip/aes/dv/tb/tb.sv','hw/top_darjeeling/ip/ast/rtl/ast.sv','hw/top_earlgrey/ip/ast/rtl/ast.sv']}
|
|
initial=state()
|
|
for i,phase in enumerate(['offerkinds','offerqueue','offeredit','renametrace','scan','rss','scanloadprobe','scanloadcross','refactor','execute']):
|
|
labels=list(bins) if i%2==0 else list(reversed(bins))
|
|
for label in labels:
|
|
cmd=['tools/guard.sh','-m','8','-t','1800','--','python3','tools/perf/bench.py',phase,'--server',bins[label],'--label',label,'--opentitan',str(corpus),'--storage',str(out/'caches'/label),'--out',str(out/'results.jsonl'),'--tries','3']
|
|
r=dict(phase=phase,label=label,command=cmd,start=time.time(),load_before=os.getloadavg())
|
|
print('START',phase,label,flush=True)
|
|
with (out/(phase+'-'+label+'.log')).open('w') as f:p=subprocess.run(cmd,cwd=root,env=dict(os.environ,PYTHONDONTWRITEBYTECODE='1'),stdout=f,stderr=subprocess.STDOUT)
|
|
r.update(exit=p.returncode,end=time.time(),load_after=os.getloadavg(),corpus_unchanged=state()==initial)
|
|
with (out/'runs.jsonl').open('a') as f:f.write(json.dumps(r)+'\n')
|
|
print('END',phase,label,p.returncode,flush=True)
|
|
if p.returncode or not r['corpus_unchanged']:raise RuntimeError(r)
|
|
|
|
# Author: Guoliang Chen. Lucisv is made by Guoliang Chen with love, luciochen.com
|