Diagnostic and cause
LinkInvalid extern replay or sandbox binding
- Family
- topaz
- Phase
- check
- Code
TPZ5032
Cause and conditions
An imported extern module needs a valid deterministic replay binding. Malformed replay data is rejected at the module import.
Related rule: Invalid extern replay or sandbox bindingResponse
Provide the replay fixture required by the declared extern module. Correct malformed fixture data and add the missing operation entry.
Source evidence
- compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 779-787 - compiler/crates/topaz_self_frontend/topaz/checker.tpz at
151141d7bb44· 337-337 - compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 255-268 - compiler/crates/topaz_self_frontend/topaz/checker.tpz at
151141d7bb44· 294-306 - compiler/crates/topaz_self_frontend/topaz/checker.tpz at
151141d7bb44· 309-341 - compiler/crates/topaz_cli/src/tests/externs.rs at
151141d7bb44· 1398-1453 - compiler/crates/topaz_cli/src/tests/externs.rs at
151141d7bb44· 831-842
Compiler phase: check/package.
Compiler explanation: An extern module is missing a deterministic replay fixture, has invalid replay data, or calls an entry not present in replay.
Message templates. The marker ⟨value⟩ stands for text computed for the reported program.
- extern module
⟨value⟩has an invalid deterministic replay binding: ⟨value⟩ Source
An imported extern module needs a valid deterministic replay binding. Malformed replay data is rejected at the module import.
Invalid extern replay or sandbox binding
An imported extern module needs a valid deterministic replay binding. Malformed replay data is rejected at the module import.
Source evidence
- compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 255-268 - compiler/crates/topaz_self_frontend/topaz/checker.tpz at
151141d7bb44· 294-306 - compiler/crates/topaz_self_frontend/topaz/checker.tpz at
151141d7bb44· 309-341 - compiler/crates/topaz_cli/src/tests/externs.rs at
151141d7bb44· 1398-1453 - compiler/crates/topaz_cli/src/tests/externs.rs at
151141d7bb44· 831-842
Response
LinkProvide the replay fixture required by the declared extern module. Correct malformed fixture data and add the missing operation entry.
Reproduction and verification
LinkRejected program
Linkimport host.math { twice }export function main(args: Array<string>, stdin: string) -> Result<int, string> {Ok(0)}
No stdout.
[package]name = "diagnostic_extern"version = "0.1.0"language = "5.21"entry = "main.tpz"[extern.host.math]hash = "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"abi_hash = "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"[[extern.host.math.functions]]name = "twice"params = ["int"]result = "int"[extern.host.math.replay]fixture = "replay/host-math.jsonl"[extern.host.math.sandbox]kind = "replay"
{"module":"host.math","function":"twice","args":"not-array","result":{"$":"int","value":"42"}}
Expected result
Expected result
Rejection during check. Nonzero exit.
TPZ5032diagnostics-invalid-extern-replay atmain.tpz:1:8
This complete package fixture uses invocationArgs without a positional source file.
Source evidence
- compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 255-268 - compiler/crates/topaz_self_frontend/topaz/checker.tpz at
151141d7bb44· 294-306 - compiler/crates/topaz_self_frontend/topaz/checker.tpz at
151141d7bb44· 309-341 - compiler/crates/topaz_cli/src/tests/externs.rs at
151141d7bb44· 1398-1453 - compiler/crates/topaz_cli/src/tests/externs.rs at
151141d7bb44· 831-842
Repaired program
Linkimport host.math { twice }export function main(args: Array<string>, stdin: string) -> Result<int, string> {Ok(0)}
[package]name = "diagnostic_extern"version = "0.1.0"language = "5.21"entry = "main.tpz"[extern.host.math]hash = "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"abi_hash = "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"[[extern.host.math.functions]]name = "twice"params = ["int"]result = "int"[extern.host.math.replay]fixture = "replay/host-math.jsonl"[extern.host.math.sandbox]kind = "replay"
{"module":"host.math","function":"twice","args":[{"$":"int","value":"21"}],"result":{"$":"int","value":"42"}}
Expected result
Expected result
Checking accepts the program. Exit code 0.
This complete package fixture uses invocationArgs without a positional source file.
Source evidence
- compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 255-268 - compiler/crates/topaz_self_frontend/topaz/checker.tpz at
151141d7bb44· 294-306 - compiler/crates/topaz_self_frontend/topaz/checker.tpz at
151141d7bb44· 309-341 - compiler/crates/topaz_cli/src/tests/externs.rs at
151141d7bb44· 1398-1453 - compiler/crates/topaz_cli/src/tests/externs.rs at
151141d7bb44· 831-842