Skip to content

testdata: expand the schema-extensions conformance corpus (#68) - #156

Merged
trendvidia merged 1 commit into
mainfrom
conformance-corpus-68
Jul 24, 2026
Merged

testdata: expand the schema-extensions conformance corpus (#68)#156
trendvidia merged 1 commit into
mainfrom
conformance-corpus-68

Conversation

@trendvidia

Copy link
Copy Markdown
Owner

Closes #68. Expands the corpus from 12 to 20 numbered fixtures plus an invalid/ suite, covering all five bullets of the issue:

Declaration shapes — 13_declaration_shapes.proto. Paren-less and empty-paren annotation declarations; params of every §5.1 type (string/int32/int64/float/double/bool/bytes/any/expression and qualified-ident enum + message types) with defaults incl. negative literals; zero-param and multi-param functions; a function with both an option list and trailing annotations; a bare type alias; use sites with no parens, empty parens, all-defaulted args, positional-then-named args, bytes/float/negative args, bare enum-value refs, and message literals with and without the optional leading type name.

Composition — 14_refinement_kinds.proto. Enum, wrapper (plus a chained derived alias), and message refinement; field-level rules stacked atop a chain; an alias as a repeated element type. (Chained refinement over primitives was already covered by 02.)

Placements were already covered by 03 (message/oneof/service/rpc/enum/enum-value leading, field/enum-value trailing); 13 adds the trailing annotation list on functionDecl.

Error states — one report-golden fixture each, following the 07 executable pattern (schema + instance directory, top-level golden, pinned stubs/catalogs in the schema header):

  • 17_missing_impl_golden — missing impl: lenient engine ⇒ reserved protowire.function.unimplemented with the spec-pinned fallback template; strict engines fail startup.
  • invalid/arity_mismatch.proto — invalid signature: declared-function call arity mismatch is a compile error (§8.1).
  • 18_default_unsatisfiable_golden — unsatisfiable rule: @default failing its own field's rules ⇒ RULE_KIND_DEFAULT with the substituted default as actual_value.
  • 19_catalog_miss — locale catalog miss: Report golden plus a messages_de.txt rendering golden (catalog hit interpolates function-authored params; miss falls back verbatim).

Plus two goldens the ledger routed to #68: 15_collections_golden (per-element repeated/map validation incl. the key dimension with for_key, #141/#153) and 16_sensitive_golden (§6.7 redaction at all three attachment sites, #90/#21).

Round trip. Documented in the README as the corpus's descriptor-level contract and verified here: the full positive corpus (all 17 schema fixtures + libraries, 24 files) compiles and lowers through the reference protocompile pipeline, and the lowered FileDescriptorSet round-trips through stock protoc (decode → re-encode with the carrier + pxf schemas in scope) byte-identically (§8.5). All six report goldens, the config golden, and the carrier golden protoc --encode cleanly. The executable harness stays in protocheck's roundtrip/ (private-module graph); expanding its fixture list rides the next protowire pin bump.

Verification. Every positive fixture compiled + carrier-dumped through local protocompile; all eight invalid/ fixtures rejected with diagnostics attributable to their manifest error class; goldens 16–19 are byte-for-byte the reports protocheck v2.1.0 emits (engine/wall_time omitted per cross-port equality); golden 15 matches except the map-key violation, which is spec-authored because the engine does not validate the key dimension yet.

Reference-toolchain gaps found and filed while building this:

Ledger #19 marked resolved in docs/RFC-001-issues.md.

Comprehensive coverage per issue #68: every declaration shape (13),
refinement over every value-shaped base kind (14), report goldens for
collection/key validation incl. for_key (15), @sensitive redaction
(16), the four named error states — missing impl (17), unsatisfiable
default (18), locale-catalog miss (19), and invalid signature plus
seven more must-not-compile fixtures (invalid/) — with the
protocompile -> stock protoc -> re-marshal round-trip contract
documented in the README (verified byte-identical over the full
lowered corpus).

Runtime goldens computed with protocheck and audited against the spec;
the 15 map-key violation is spec-authored (engine gap
trendvidia/protocheck#53). Fixture 14 pins fully-qualified
TypeDecl.base_type_fqn (drift tracked in trendvidia/protocompile#121).
Ledger #19 resolved.
@trendvidia
trendvidia merged commit 52d5056 into main Jul 24, 2026
5 checks passed
@trendvidia
trendvidia deleted the conformance-corpus-68 branch July 24, 2026 19:19
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.

Conformance test corpus expansion

1 participant