8.1 KiB
PBS Conformance Test Specification
Status: Draft v1 (Temporary)
Applies to: conformance obligations, test categories, and acceptance criteria for PBS implementations
1. Purpose
This document defines the current PBS conformance-test baseline for v1.
Its purpose is to make the active specification operational by stating:
- which categories of behavior must be tested,
- which outcomes must be deterministic across conforming implementations,
- and which parts of the corpus are not yet mature enough to demand full conformance coverage.
2. Scope
This document defines:
- required positive and negative source-level conformance surfaces,
- runtime-oracle expectations already fixed by active semantics,
- minimum host-binding and capability-gating test surfaces,
- and the current limits of v1 conformance while diagnostics and lowering remain incomplete.
This document does not define:
- one specific test harness or repository layout,
- benchmark or performance certification,
- one artifact-level golden format,
- or product release governance policy.
3. Authority and Precedence
Normative precedence:
1. Language Charter.md2. Governance and Versioning.md3. Core Syntax Specification.md4. Static Semantics Specification.md5. Manifest, Stdlib, and SDK Resolution Specification.md6.2. Host ABI Binding and Loader Resolution Specification.md7. Cartridge Manifest and Runtime Capabilities Specification.md9. Dynamic Semantics Specification.md10. Memory and Lifetime Specification.md11. Diagnostics Specification.md12. IR and Lowering Specification.md- This document
This document must not weaken a normative requirement imposed by higher-precedence specs.
4. Normative Inputs
This document depends on the active PBS v1 spec set.
For the currently integrated conformance baseline, the key inputs are:
3. Core Syntax Specification.md4. Static Semantics Specification.md5. Manifest, Stdlib, and SDK Resolution Specification.md6.2. Host ABI Binding and Loader Resolution Specification.md7. Cartridge Manifest and Runtime Capabilities Specification.md9. Dynamic Semantics Specification.md10. Memory and Lifetime Specification.md
Later expansion of this document will also depend on:
11. Diagnostics Specification.md12. IR and Lowering Specification.md15. Bytecode and PBX Mapping Specification.md
5. Already-Settled Inputs
The following inputs are already fixed elsewhere and must not be contradicted here:
- The parser must behave deterministically.
- Syntax and static semantics already enumerate minimum required rejection cases.
- Import/manifest failures are required to be deterministic.
- Loader failures for malformed or unauthorized host usage are required to be deterministic.
- Dynamic semantics are single-threaded and deterministic at the language-observable level.
- Memory semantics already distinguish identity-bearing values from pure-value and carrier forms.
- Traps are fatal runtime aborts rather than recoverable userland outcomes.
6. Current Conformance Baseline
At the current maturity level, a conforming PBS implementation must support tests in the following categories:
- positive syntax and parsing tests,
- negative syntax rejection tests,
- positive binding and static-typing tests,
- negative static-semantics rejection tests,
- manifest/import-resolution tests,
- host-binding and capability-gating tests,
- source-level dynamic-semantics runtime tests,
- source-level memory/identity behavior tests,
- compatibility/regression tests for already-published behavior claims.
7. Source-Level Runtime Oracle
The current conformance oracle for runtime behavior is source-level and language-observable.
At minimum, conformance tests must cover:
- strict left-to-right evaluation where the language does not define an exception,
- exactly-once evaluation of:
- call-target formation,
- call arguments,
ifconditions,switchselectors,some(expr)payload formation,bind(context, fn_name)context capture,
optionalbehavior:some(expr)is eager,noneis canonical absence,opt else fallbackevaluatesfallbackonly onnone,
resultbehavior:expr!passes through success payload,expr!immediately propagates same-domain error,handle expr { ... }passes through success payload,handleblock arms terminate withok(payload)orerr(E.case),- short
handlearms remap error as specified,
- branch-selection behavior:
- non-selected
ifandswitcharms do not execute, switchselects deterministically over admitted static discriminants,
- non-selected
- trap behavior:
- traps do not enter
resultflow, - traps are not intercepted by
handle, - traps abort the running PBS program path.
- traps do not enter
Conformance does not currently require a userland-visible trap taxonomy. It requires only the fatal-abort boundary already defined by the runtime and dynamic-semantics specs.
8. Source-Level Memory and Identity Oracle
At minimum, conformance tests must cover the following language-observable memory/identity facts:
structvalues are identity-bearing and alias through assignment, parameter passing, and return,servicevalues preserve singleton identity,- tuples,
optional, andresultdo not create new userland identity of their own, - carriers preserve the identity behavior of their payloads,
bind(context, fn_name)captures the same runtime identity of thestructcontext rather than copying it,- callback invocation after
bindobserves mutation against that same captured context identity, - GC timing itself is not a conformance oracle,
- reclamation is validated only indirectly through correctness and safety boundaries, not through collection timing.
9. Host-Binding and Boundary Tests
At minimum, conformance tests must cover:
- deterministic rejection of malformed or unauthorized host usage,
- deterministic acceptance of valid host-backed declarations admitted by the active capability/runtime line,
- correct source-level behavior of host-backed calls that are already admitted by the Host ABI and capability specs,
- the absence of userland-visible raw pointers or heap-shared host-memory surfaces at the PBS boundary.
This document does not yet require one artifact-level oracle for host-lowering shape. That remains dependent on later closure of lowering and PBX-mapping specifications.
10. TODO
The following items remain open before this document can be considered complete:
10.1 Depends on 11. Diagnostics Specification.md
- whether conformance checks diagnostic codes, spans, categories, wording classes, or only rejection phase and location;
- which warnings or cost diagnostics are in conformance scope.
10.2 Depends on 12. IR and Lowering Specification.md and 15. Bytecode and PBX Mapping Specification.md
- whether artifact-level conformance is required in addition to source-level conformance;
- which emitted host-binding and lowering invariants require golden tests;
- which source-to-artifact mapping hooks are part of the conformance contract.
10.3 Still to decide inside this document
- whether PBS v1 has one conformance level or staged claims such as frontend-only versus full toolchain;
- fixture strategy for stdlib environments, host registries, and capability-grant scenarios;
- how compatibility-matrix claims are validated across language/profile/stdlib domains.
11. Non-Goals
- Replacing the normative specs with tests as the primary authority.
- Forcing one repository layout or one test harness.
- Treating performance benchmarking as language conformance.
- Inventing new language rules through test-only precedent.
12. Exit Criteria
This document is ready to move beyond temporary status only when:
- every active PBS v1 spec has a corresponding conformance surface,
- positive and negative obligations are clearly separated,
- diagnostics and artifact-level behavior have explicit oracle expectations where required,
- compatibility and version claims can be tested rather than asserted informally,
- and the document no longer relies on unresolved TODO items for the intended conformance level.