hw-verify / CONTRIBUTING.md
nickh007's picture
Refuse rather than guess: UNKNOWN verdicts for unreadable designs
4286e2f verified
|
Raw
History Blame Contribute Delete
1.94 kB

Contributing to the hw-verify dataset

The data is generated, never hand-edited

Do not edit anything under data/. Every record is computed by build.py from the packages' real artifacts, and python build.py --check fails if the committed files differ from a fresh build. A hand-edited record is a record that no longer matches the tool that supposedly produced it — which is the one thing a dataset like this cannot survive.

To change the data, change the source of truth (a fixture, a gadget, a defect class in the upstream package), then regenerate:

python build.py
pytest tests -q

Every split needs controls

The RTL split pairs each constant-time design with a leaky twin of identical interface. The masking split contains gadgets that genuinely recombine a secret. The patch split contains a fix that blocks one witness and a fix that rejects everything.

If you add records, add the counterexamples too. A one-sided corpus rewards a classifier that always answers the same way, and the tests enforce this: test_every_pair_has_both_halves, test_masking_includes_real_leaky_probes, test_demos_are_genuinely_broken.

Document every field

test_card_documents_every_field_of_every_split fails if a record has a field the card does not explain. This caught three undocumented fields the first time it ran. Keep it.

Licences stay per-record

Four RTL fixtures derive from picorv32 and remain under ISC; the rest are CC-BY-4.0; the masking and patch records are Apache-2.0 outputs of the tools. Do not flatten this into a single dataset-level licence — it would misstate the terms on 4 of 27 files.

Keep the scope statements

out_of_model, model, and the mean-vs-distribution split are in the data on purpose. They are the difference between a consumer reading a label as "secure" and reading it as what it actually says.

Style

ruff check . clean, pytest tests -q green.