implement PBS low-level asset host surface
This commit is contained in:
+33
@@ -93,6 +93,13 @@ Rules:
|
||||
Source-level owners such as `Gfx` are SDK-facing aliases.
|
||||
They are not loader-facing identities.
|
||||
|
||||
For the current low-level asset surface:
|
||||
|
||||
- the canonical PBS owner name is `LowAssets`,
|
||||
- the canonical runtime module remains `asset`,
|
||||
- the canonical capability remains `asset`,
|
||||
- the canonical load identity is `("asset", "load", 1)`.
|
||||
|
||||
## 6. Relationship to `declare host`
|
||||
|
||||
`declare host` is a reserved SDK/toolchain surface used to expose host-backed APIs to source programs.
|
||||
@@ -129,6 +136,25 @@ but the PBX-facing declaration is canonical, for example:
|
||||
("gfx", "draw_pixel", 1)
|
||||
```
|
||||
|
||||
The same rule applies to the low-level asset surface.
|
||||
For example, the PBS-facing declaration:
|
||||
|
||||
```pbs
|
||||
declare host LowAssets {
|
||||
[Host(module = "asset", name = "load", version = 1)]
|
||||
[Capability(name = "asset")]
|
||||
fn load(asset_id: int, slot: int) -> (status: int, loading_handle: int);
|
||||
}
|
||||
```
|
||||
|
||||
maps to the canonical runtime identity:
|
||||
|
||||
```text
|
||||
("asset", "load", 1)
|
||||
```
|
||||
|
||||
The loader MUST NOT derive runtime identity from the source owner spelling `LowAssets`.
|
||||
|
||||
## 7. PBX Host Binding Section
|
||||
|
||||
### 7.1 Temporary section contract
|
||||
@@ -243,6 +269,13 @@ Rules:
|
||||
- successful resolution yields numeric syscall identifiers and associated metadata,
|
||||
- the resolved metadata is authoritative for capability gating and later runtime verification.
|
||||
|
||||
For the current asset runtime surface, the canonical registry entries include:
|
||||
|
||||
- `("asset", "load", 1)` with `arg_slots = 2` and `ret_slots = 2`,
|
||||
- `("asset", "status", 1)` with `arg_slots = 1` and `ret_slots = 1`,
|
||||
- `("asset", "commit", 1)` with `arg_slots = 1` and `ret_slots = 1`,
|
||||
- `("asset", "cancel", 1)` with `arg_slots = 1` and `ret_slots = 1`.
|
||||
|
||||
## 10. Pre-Load Callsite Form
|
||||
|
||||
The compiler emits host-backed call sites in pre-load form as:
|
||||
|
||||
Reference in New Issue
Block a user