implements PLN-0127
Intrepid/Prometeu/Studio/pipeline/pr-master Build started...
JaCoCo Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 61.95% (17766/28676)
* Branch Coverage: 52.69% (6860/13019)
* Lines of Code: 28676
* Cyclomatic Complexity: 11490
#### Quality Gates Summary
Output truncated.
Test / Build skipped: 15, passed: 648
Intrepid/Prometeu/Studio/pipeline/pr-master Build started...
JaCoCo Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 61.95% (17766/28676)
* Branch Coverage: 52.69% (6860/13019)
* Lines of Code: 28676
* Cyclomatic Complexity: 11490
#### Quality Gates Summary
Output truncated.
Test / Build skipped: 15, passed: 648
Publish the console ABI authority map: runtime catalogs win, PBS stdlib is delivery. Recut specs 18, 8, and 6.2 and lock them with ConsoleAbiAuthoritySpecTest. Housekeep DSC-0061 with LSN-0064.
This commit is contained in:
+17
-6
@@ -15,6 +15,10 @@ This document defines the current contract between:
|
||||
Its purpose is to let compiler and runtime work in parallel without diverging on the most critical boundary:
|
||||
how host-backed SDK calls become load-time-resolved numeric syscalls.
|
||||
|
||||
PBS `declare host` / `[Host]` shells are compile-time delivery. The
|
||||
loader-facing catalog is runtime-owned. This document MUST NOT publish syscall
|
||||
IDs or `SyscallMeta`.
|
||||
|
||||
This document is intentionally narrower than a full PBX or VM specification.
|
||||
It focuses on loader behavior and the minimum artifact contract the loader must consume.
|
||||
|
||||
@@ -44,16 +48,20 @@ This document does not define:
|
||||
|
||||
This document follows two prior decisions:
|
||||
|
||||
1. Canonical host identity is defined by the hardware ABI as `(module, name, version)`.
|
||||
1. Canonical host identity is defined by the runtime host registry as `(module, name, version)`.
|
||||
2. User code does not declare host bindings directly; SDK/toolchain-controlled modules expose reserved `declare host` surfaces and the compiler lowers those usages into PBX host-binding metadata.
|
||||
|
||||
PBS shells MUST repeat identities already published by the runtime registry
|
||||
(`../runtime/docs/specs/runtime/16-host-abi-and-syscalls.md` and `SyscallMeta`).
|
||||
They MUST NOT invent `(module, name, version)`.
|
||||
|
||||
This document therefore treats:
|
||||
|
||||
- `declare host Gfx { fn draw_pixel(...); }`
|
||||
- `declare host LowGfx { [Host(module = "gfx2d", name = "clear", version = 1)] fn clear(...); }`
|
||||
|
||||
as compile-time surface only, and treats:
|
||||
|
||||
- `("gfx", "draw_pixel", 1)`
|
||||
- `("gfx2d", "clear", 1)`
|
||||
|
||||
as the normative runtime-facing identity.
|
||||
|
||||
@@ -63,7 +71,7 @@ The host-binding pipeline is:
|
||||
|
||||
1. User code imports SDK surfaces such as `Gfx` from `@sdk:gfx` and `Composer` from `@sdk:composer`.
|
||||
2. The compiler resolves those surfaces against the selected stdlib line.
|
||||
3. The compiler maps each host-backed SDK member to a canonical identity `(module, name, version)`.
|
||||
3. The compiler maps each host-backed SDK member to a canonical identity `(module, name, version)` that already exists in the runtime host registry.
|
||||
4. The compiler emits those required canonical identities into the PBX `SYSC` table.
|
||||
5. The compiler emits pre-load host call sites as `HOSTCALL <sysc_index>`.
|
||||
6. At cartridge load time, the loader resolves `SYSC` entries against the host syscall registry.
|
||||
@@ -84,7 +92,7 @@ Every host binding is identified by the triple:
|
||||
|
||||
Rules:
|
||||
|
||||
- `module` is the canonical host subsystem namespace, such as `gfx` or `audio`.
|
||||
- `module` is the canonical host subsystem namespace, such as `gfx2d` or `asset`.
|
||||
- `name` is the canonical host operation name within that module.
|
||||
- `version` is the canonical ABI version of that host operation.
|
||||
- This identity is stable across source languages and SDK naming styles.
|
||||
@@ -310,7 +318,10 @@ Rules:
|
||||
- the loader resolves only against this canonical registry,
|
||||
- unknown identities are load errors,
|
||||
- successful resolution yields numeric syscall identifiers and associated metadata,
|
||||
- the resolved metadata is authoritative for capability gating and later runtime verification.
|
||||
- the resolved metadata is authoritative for capability gating and later runtime verification,
|
||||
- PBS `declare host` / `[Host]` shells MUST repeat identities from this registry,
|
||||
- PBS shells MUST NOT invent `(module, name, version)`,
|
||||
- this specification MUST NOT publish the syscall catalog; runtime spec 16 and `SyscallMeta` do.
|
||||
|
||||
For the current asset runtime surface, the canonical registry entries include:
|
||||
|
||||
|
||||
+49
-30
@@ -16,7 +16,11 @@ Its purpose is to make the stdlib:
|
||||
|
||||
This document complements the normative language-level model in:
|
||||
|
||||
- [5. Manifest, Stdlib, and SDK Resolution Specification.md](/Users/niltonconstantino/personal/workspace.personal/intrepid/prometeu/studio/docs/specs/pbs/5.%20Manifest,%20Stdlib,%20and%20SDK%20Resolution%20Specification.md)
|
||||
- [5. Manifest, Stdlib, and SDK Resolution Specification.md](5.%20Manifest%2C%20Stdlib%2C%20and%20SDK%20Resolution%20Specification.md)
|
||||
|
||||
This document is PBS packaging. It MUST NOT define console ABI. Intrinsic
|
||||
`final_id` values and host `SyscallMeta` remain runtime-owned. Physical stdlib
|
||||
path MUST NOT imply VM-owned versus host-backed ownership.
|
||||
|
||||
## 2. Scope
|
||||
|
||||
@@ -53,52 +57,66 @@ The recommended Studio layout is:
|
||||
```text
|
||||
prometeu-compiler/frontends/prometeu-frontend-pbs/
|
||||
src/main/resources/
|
||||
stdlib/
|
||||
1/
|
||||
sdk/
|
||||
composer/
|
||||
main.pbs
|
||||
mod.barrel
|
||||
gfx/
|
||||
main.pbs
|
||||
mod.barrel
|
||||
asset/
|
||||
main.pbs
|
||||
mod.barrel
|
||||
audio/
|
||||
main.pbs
|
||||
mod.barrel
|
||||
core/
|
||||
math/
|
||||
main.pbs
|
||||
mod.barrel
|
||||
<target>/
|
||||
stdlib/
|
||||
1/
|
||||
core/
|
||||
color/
|
||||
main.pbs
|
||||
mod.barrel
|
||||
sdk/
|
||||
asset/
|
||||
main.pbs
|
||||
mod.barrel
|
||||
composer/
|
||||
main.pbs
|
||||
mod.barrel
|
||||
gfx/
|
||||
main.pbs
|
||||
mod.barrel
|
||||
input/
|
||||
main.pbs
|
||||
mod.barrel
|
||||
log/
|
||||
main.pbs
|
||||
mod.barrel
|
||||
```
|
||||
|
||||
Interpretation:
|
||||
|
||||
- `stdlib/1` selects stdlib major line `1`,
|
||||
- `<target>` is the `AppMode` export name (`game` for the current line-1 environment),
|
||||
- `game/stdlib/1` selects stdlib major line `1` for that target,
|
||||
- `sdk` and `core` are reserved project spaces,
|
||||
- `composer`, `gfx`, `audio`, `math` are module paths within those reserved spaces,
|
||||
- current line `1` modules are `color`, `asset`, `composer`, `gfx`, `input`, and `log`,
|
||||
- `main.pbs` and `mod.barrel` form the interface module contents.
|
||||
|
||||
Current line `1` MUST NOT be documented as shipping `audio` or `@core:math`.
|
||||
Those names are not packaged in the current environment. `@sdk:input` is a
|
||||
VM-owned builtin shell; its path does not make it host-backed.
|
||||
|
||||
## 5. Logical Mapping
|
||||
|
||||
The compiler must treat the physical layout as a logical stdlib environment.
|
||||
|
||||
Required mapping:
|
||||
|
||||
- `stdlib/<N>/sdk/gfx` -> `@sdk:gfx`
|
||||
- `stdlib/<N>/sdk/composer` -> `@sdk:composer`
|
||||
- `stdlib/<N>/sdk/asset` -> `@sdk:asset`
|
||||
- `stdlib/<N>/sdk/audio` -> `@sdk:audio`
|
||||
- `stdlib/<N>/core/math` -> `@core:math`
|
||||
- `stdlib/<N>/core/math/vector` -> `@core:math/vector`
|
||||
- `<target>/stdlib/<N>/<space>/<module>` -> `@<space>:<module>`
|
||||
|
||||
Current line `1` (`game`) mapping:
|
||||
|
||||
- `game/stdlib/1/core/color` -> `@core:color`
|
||||
- `game/stdlib/1/sdk/asset` -> `@sdk:asset`
|
||||
- `game/stdlib/1/sdk/composer` -> `@sdk:composer`
|
||||
- `game/stdlib/1/sdk/gfx` -> `@sdk:gfx`
|
||||
- `game/stdlib/1/sdk/input` -> `@sdk:input`
|
||||
- `game/stdlib/1/sdk/log` -> `@sdk:log`
|
||||
|
||||
Rules:
|
||||
|
||||
- physical storage is an implementation detail,
|
||||
- logical module identity is authoritative,
|
||||
- callers of the resolver should work with logical addresses such as `@sdk:gfx` and `@sdk:composer`, not resource paths.
|
||||
- callers of the resolver should work with logical addresses such as `@sdk:gfx` and `@core:color`, not resource paths,
|
||||
- physical path MUST NOT imply VM-owned versus host-backed ownership.
|
||||
|
||||
## 6. Module File Convention
|
||||
|
||||
@@ -150,7 +168,8 @@ Minimum operations:
|
||||
|
||||
- `resolve(@sdk:gfx)`
|
||||
- `resolve(@sdk:composer)`
|
||||
- `resolve(@core:math/vector)`
|
||||
- `resolve(@sdk:input)`
|
||||
- `resolve(@core:color)`
|
||||
|
||||
### 7.3 `StdlibModuleSource`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user