90 lines
7.0 KiB
Markdown
90 lines
7.0 KiB
Markdown
# Take 5 baseline evidence — 0.50.0, bbdbfe9
|
|
|
|
Read [the analysis and plan](../../performance_take5.md) and [implementation tracker](../take5-tracking.md). These are measured inputs to future implementation; no optimization is included.
|
|
|
|
| File | Meaning |
|
|
|---|---|
|
|
| `metadata.json` | Commits, binary and modified corpus hashes, environment, limitations |
|
|
| `results.jsonl` | Standard LSP rows; ordinary `ms` arrays are first + repeats except scan/didOpen and RSS |
|
|
| `runs.jsonl` | Standard-phase commands, before/after load, exit status and corpus checks |
|
|
| `offer-breakdown.jsonl` | Filtered action requests/counts; `offer-queue.ms` is leader/follower milliseconds |
|
|
| `cli-results.jsonl` | Paired CLI times, commands, exit status, summaries, stdout hashes, peak RSS bytes |
|
|
|
|
The original `rss` rows use `ms` for **KiB of idle RSS**, and `n` for **KiB of allocated store size**. Do not treat them as latency or peak memory. CLI formatter exit 2 reflects four existing failures; lint exit 1 reflects findings. Tiny extract/inline `resolve` rows are invalid measures of command execution and excluded from conclusions.
|
|
|
|
Standard phases ran sequentially under `tools/guard.sh -m 8 -t 1800`, using commands in `runs.jsonl`. Baseline cache warm-up preceded code-action sessions. `scan` resets cold caches; its initial default-scope scan can populate entries before the final workspace scan. No Cargo command ran during retained timing sessions. Source was not modified. CLI raw logs remain in `/tmp/lucisv-perf5-20260907`; summaries and stdout hashes survive here.
|
|
|
|
## Reproduce
|
|
|
|
Run a guarded release build first. After all builds stop, run the phase command in `runs.jsonl`, replacing its output, label and storage with a new scratch run. Reference and candidate need separate, identically primed caches. Record exact binary/source/corpus hashes. Check corpus status and hashes before/after each phase.
|
|
|
|
## Supplemental read-only probes
|
|
|
|
These scripts ran from scratch, not as changes to the production harness. Save each block to a scratch `.py` file and update the explicit paths, labels and output names. Run the offer probe under `tools/guard.sh -m 8 -t 1800`; the CLI probe guards each child internally. Do not run either concurrently with another benchmark or a build. Returned edits are discarded.
|
|
|
|
### Action-family attribution
|
|
|
|
```python
|
|
import sys, argparse, copy, json, os
|
|
sys.path.insert(0,'/Users/guoliangchen/repo/verilogrustformatter/tools/perf')
|
|
import harness as h, sites
|
|
h.configure(argparse.Namespace(server='/Users/guoliangchen/repo/verilogrustformatter/target/release/lucisv-server',label='0.50.0-bbdbfe9',opentitan='/Users/guoliangchen/repo/opentitan',storage='/tmp/lucisv-perf5-20260907/caches',out='/tmp/lucisv-perf5-20260907/offer-breakdown.jsonl',tries=3))
|
|
shapes=[('tb-comment',sites.TB,'// ',2),('aes-reg-instance',sites.AES,'aes_reg_top u_reg (',0),('aes-core-comment',sites.AES_CORE,'// ',2),('spi-comment',sites.SPI_DEVICE,'// ',2),('pinmux-comment',sites.PINMUX_REG_TOP,'// ',2)]
|
|
for label,relative,needle,offset in shapes:
|
|
with h.session('workspace') as s:
|
|
h.settled(s)
|
|
s.did_open(sites.path(relative)); s.wait_quiet(.6); s.take_notifications()
|
|
p=h.code_action_params(relative,needle,offset=offset)
|
|
for kind in [None,[],['quickfix'],['refactor.extract'],['refactor.inline'],['refactor.rewrite.lucisv.ports'],['source.organizeImports']]:
|
|
params=copy.deepcopy(p)
|
|
if kind is not None: params['context']['only']=kind
|
|
elapsed=[]; answer=None
|
|
for i in range(4):
|
|
ms,answer=s.request('textDocument/codeAction',params)
|
|
if 'error' in answer: raise RuntimeError(answer)
|
|
elapsed.append(ms)
|
|
h.record(phase='offer-breakdown',row=label+' '+str(kind),ms=elapsed,n=len(answer.get('result') or []),file=relative,position=p['range']['start'],load=os.getloadavg())
|
|
if label=='pinmux-comment':
|
|
for i in range(3):
|
|
leader=s.send('textDocument/codeAction',p)
|
|
follower=s.send('textDocument/definition',h.at(sites.TB,' aes #(',offset=2))
|
|
lm,lr=s.await_id(leader); fm,fr=s.await_id(follower)
|
|
h.record(phase='offer-queue',row='pinmux comment -> aes definition',ms=[lm,fm],note='leader/follower ms, not repeats')
|
|
```
|
|
|
|
### Paired CLI and independently cold formatting
|
|
|
|
```python
|
|
import subprocess, pathlib, os, time, json, re, shutil, hashlib
|
|
root=pathlib.Path('/Users/guoliangchen/repo/verilogrustformatter')
|
|
out=pathlib.Path('/tmp/lucisv-perf5-20260907'); corpus='/Users/guoliangchen/repo/opentitan'
|
|
tree=corpus+'/hw/ip'
|
|
binaries={'0.50.0':str(root/'target/release/lucisv'),'0.49.0':'/Users/guoliangchen/.cache/lucisv-baselines/lucisv-0.49.0','0.43.0':'/Users/guoliangchen/.cache/lucisv-baselines/lucisv-0.43.0'}
|
|
initial=subprocess.check_output(['git','-C',corpus,'status','--porcelain'],text=True)
|
|
def run(label,kind,trial,args):
|
|
cmd=[str(root/'tools/guard.sh'),'-m','8','-t','1800','--','/usr/bin/time','-l',binaries[label]]+args+[tree]
|
|
load=os.getloadavg()
|
|
r=subprocess.run(cmd,cwd=root,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
|
|
log=r.stdout+r.stderr
|
|
(out/f'cli-{label}-{kind}-{trial}.log').write_bytes(log)
|
|
err=r.stderr.decode(errors='replace')
|
|
timing=re.search(r'([\d.]+) real\s+([\d.]+) user\s+([\d.]+) sys',err)
|
|
rss=re.search(r'(\d+)\s+maximum resident set size',err)
|
|
summary=[x for x in log.decode(errors='replace').splitlines() if re.search(r'files? (checked|already|would|from)|violations? in|failed to format|files?,',x)]
|
|
record=dict(label=label,row=kind,trial=trial,command=cmd,exit=r.returncode,wall_s=float(timing[1]) if timing else None,user_s=float(timing[2]) if timing else None,sys_s=float(timing[3]) if timing else None,peak_rss_bytes=int(rss[1]) if rss else None,summary=summary[-4:],stdout_sha256=hashlib.sha256(r.stdout).hexdigest(),load_before=load,load_after=os.getloadavg(),corpus_unchanged=initial==subprocess.check_output(['git','-C',corpus,'status','--porcelain'],text=True))
|
|
with (out/'cli-results.jsonl').open('a') as f:f.write(json.dumps(record)+'\n')
|
|
print(label,kind,trial,record['wall_s'],record['summary'],flush=True)
|
|
if r.returncode not in (0,1,2) or not record['corpus_unchanged'] or not timing: raise RuntimeError(record)
|
|
for trial in range(1,4):
|
|
for label in (list(binaries) if trial%2 else list(reversed(binaries))):
|
|
for kind,args in [('default',['check']),('style',['check','--select','error,warning,style']),('style-no-unused-import',['check','--select','error,warning,style','--ignore','unused-import'])]:
|
|
if label=='0.43.0' and kind=='style-no-unused-import':continue
|
|
run(label,kind,trial,args)
|
|
cache=out/'cli-format-cache'
|
|
shutil.rmtree(cache,ignore_errors=True)
|
|
for warmth in ['cold','warm']:
|
|
run('0.50.0','format-'+warmth,trial,['format','--check','--cache-dir',str(cache)])
|
|
```
|
|
|
|
The CLI probe's summary matcher missed `found N violations`; these summary fields were filled from the saved raw logs afterward. Timings, exit codes, hashes and memory figures are unmodified.
|