Why a Second FACET Implementation Found What Tests Missed
A reference implementation can pass every test it wrote and still agree only with itself.
I have just seen that boundary become concrete in FACET. A second Core-profile implementation was written from the specification text rather than from the Rust compiler. The goal was not to replace the reference implementation. It was to force two independent readers to answer the same normative questions.
They disagreed four times. The most serious disagreement changed the byte identity of a contract.
That is the kind of result I want from conformance work. Not another green badge. A precise place where the standard did not say enough.
One specification, two defensible hashes
FACET defines metadata.document_hash as SHA-256 over the Resolved Source Form: normalized source after imports have been expanded. Execution artifacts and attestations can use that hash to identify the contract that governed a run.
The specification said imported content was expanded “in place.” That sounded exact until two implementations had to produce bytes.
One spliced the imported source one way. The other inserted it with a different newline boundary. Both readings were defensible. Both produced valid-looking source. They produced different hashes:
reference: sha256:3bd041eeca7734ded988b83da42d49ef08d405241a2923ec0ab79e6ed3b91a00
second: sha256:4eb3df04d754e46cb373654b50278c99aa4ead5a56f3aee10865e32798ce02c1
This is not cosmetic serialization drift. If two conforming systems assign different identities to the same contract, a cache key, provenance chain, approval record, or replay check can split at the first byte.
The correction now pins the operation: replace the @import line with the imported document’s own Resolved Source Form, ensure exactly one trailing newline, and introduce no other separator. The rule is small because the ambiguity was small. Its effect is architectural because identity depends on it.
Why the reference compiler could not find this alone
An implementation must make unspecified choices to keep moving. A parser chooses a boundary. A resolver chooses a separator. A renderer chooses what to do when a profile lacks an execution phase. Once encoded, those choices become invisible inside the codebase. Tests normally preserve them.
This creates a dangerous loop:
implementation assumption
↓
expected fixture
↓
passing regression test
↓
assumption looks normative
More tests do not necessarily break the loop. If expected outputs come from the same implementation or from people already familiar with its behavior, the suite can become an increasingly accurate description of one codebase.
A clean-room implementation changes the question. It does not ask, “Can I reproduce the compiler?” It asks, “What behavior can I derive from the published words?” Every divergence then has three possible causes:
| Divergence | Meaning | Correct response |
|---|---|---|
| One implementation violates explicit text | implementation defect | fix code and add a regression |
| Both readings are allowed by the text | specification ambiguity | make the normative rule explicit |
| The standard intentionally permits variation | conformance boundary | declare the variation and test only the invariant |
That classification is the useful artifact. A diff without that judgment is only noise.
The unresolved cases are as valuable as the fixed one
The second implementation also exposed open questions around the Core profile.
Core has no R-DAG, yet message content can contain a variable reference. Should Core reject it because resolution requires a missing phase, render it literally, or resolve it when the variable is a supported literal? Each answer has a coherent argument. They do not produce the same canonical output.
Core also reports budget_units without implementing the Token Box Model. A payload can therefore declare a budget while exceeding it. Should Core reject the document, report the budget only as metadata, or implement a smaller layout obligation?
These are not reasons to hide the experiment until every answer is polished. They are the output of the experiment. The standard now has a finite list of decisions instead of silent implementation folklore.
This sharpens an earlier distinction I made in FACET compliance levels: a conformance claim needs a declared surface. A second implementation goes one step further. It tests whether that surface can be reconstructed without access to the reference compiler’s private assumptions.
A practical differential-conformance loop
For a language or contract system, I would run the process as a small engineering loop:
- Freeze the target. Pin the specification revision, profile, mode, fixtures, and reference compiler commit.
- Build from prose. Keep the second implementation structurally independent. Do not port parser or resolver code from the reference.
- Compare semantic artifacts. Diff normalized source, AST shape, canonical JSON, diagnostics, hashes, and execution artifacts—not only exit codes.
- Minimize every divergence. Reduce it to the smallest source document that still produces disagreement.
- Classify before fixing. Decide whether the defect belongs to an implementation, the specification, or the declared conformance boundary.
- Change the right layer. A normative ambiguity needs specification text and cross-implementation fixtures. A local defect needs code and a regression test.
- Keep the disagreement executable. The minimized case should run in CI against both implementations.
The minimization step matters. A large agent workflow can disagree for ten reasons at once. A three-line import fixture can reveal that the actual problem is one unspecified newline.
FACET already treats tests as executable contracts. Differential conformance adds another contract: independent implementations must agree on normative artifacts, while permitted differences remain explicitly outside the claim.
What this evidence does not prove
A second implementation does not prove full FACET correctness. The current Python implementation targets the Core profile, not the complete Hypervisor surface. Agreement on selected fixtures does not validate model behavior, provider transport, security of every host integration, or all normative requirements.
It also does not make the reference compiler irrelevant. The reference remains the broad implementation and operational tool. The second implementation has a different job: expose assumptions by refusing to inherit them.
NIST describes conformance testing as checking an implementation against the requirements of a standard. That is necessary. For a standard with multiple implementations, I would add a harder question: can independent implementers infer the same required behavior from the standard itself?
If the answer is no, the failure may not be in either program. It may be in the space between the sentences.
That space is where standards become real.