Skip to content

schemas: rm unused schema, dedupe sig vectors, more req'd fields, codegen in CI#215

Merged
cpu merged 7 commits intomainfrom
cpu-codegen-tweaks
Mar 4, 2026
Merged

schemas: rm unused schema, dedupe sig vectors, more req'd fields, codegen in CI#215
cpu merged 7 commits intomainfrom
cpu-codegen-tweaks

Conversation

@cpu
Copy link
Member

@cpu cpu commented Feb 17, 2026

Similar to #214, this branch rolls up some more changes I found helpful when using the schemas to generate code to use for testing the Go standard library. There are no diffs to actual test vector content, just schemas.

  • Removes dsa_verify_schema.json - this was leftover from the testvectors/ directory removed in Remove testvectors/ in favour of testvectors_v1 #169
  • Lifts up some common signature test case definitions and renames the MLDSA signing groups. This helps generator tools to avoid needing to emit multiple types with the same name.
  • Adds a bunch more properties as required. Where the value is always present in the corresponding vectors we should mark the field required. This helps code generators avoid needing to express the field as optional (e.g. Option<T> vs T in Rust, or as a *T pointer-type in Go).
  • Adds a code generation smoke-test to CI. This gives us some assurance the schemas we have checked in can be used for code generation, and also checks there are no warnings like the kind emitted for duplicate type names (e.g. Multiple types map to the name "AsnSignatureTestVector"; declaring duplicate as "AsnSignatureTestVector_1" instead) - we don't want to be in the business of maintaining these generated types, so the result isn't checked in.
  • Lifts up a common result enum definition. This helps test rig code that wants to handle results uniformly across all vector types.

cpu added 6 commits February 16, 2026 15:36
It's unused, only `dsa_verify_schema_v1.json` has references under
`testvectors_v1/`
Add more fields that are always present in the corresponding vectors to
the schema required properties lists. Also be consistent in where we put
the required & no additional properties elements.
Use go-jsonschema to generate Go code from the JSON schemas. We
explicitly don't want to distribute that generated code, but it's
helpful to verify that at least one tool is able to do codegen without
error from the schema files.

By asserting that there are no warnings we also catch cases where
identical schema object names result in duplicate type definitions that
require clunky suffixing. This is a strong indicator there's schema
elements we should de-duplicate and catching these early helps make the
schemas _and_ the generated code better.
@cpu cpu self-assigned this Feb 17, 2026
@cpu
Copy link
Member Author

cpu commented Feb 23, 2026

@FiloSottile @sgmenda Would either of you be interested in reviewing this branch? I don't think any of it is particularly controversial.

@cpu cpu merged commit d1b0cb0 into main Mar 4, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants