Keep PBX at v0 and simplify Jenkins quality gate
Intrepid/Prometeu/Runtime/pipeline/pr-master There was a failure building this commit
Intrepid/Prometeu/Runtime/pipeline/pr-master There was a failure building this commit
This commit is contained in:
@@ -20,7 +20,7 @@ jobs:
|
|||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
- name: Discard reports from previous runs
|
- name: Discard reports from previous runs
|
||||||
run: rm -rf target/quality-gate target/llvm-cov
|
run: rm -rf target/llvm-cov
|
||||||
|
|
||||||
- name: Provision quality-gate tools and native dependencies
|
- name: Provision quality-gate tools and native dependencies
|
||||||
run: bash scripts/provision-quality-gate.sh
|
run: bash scripts/provision-quality-gate.sh
|
||||||
@@ -34,6 +34,5 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: quality-gate-${{ runner.os }}-${{ github.sha }}
|
name: quality-gate-${{ runner.os }}-${{ github.sha }}
|
||||||
path: |
|
path: |
|
||||||
target/quality-gate/**
|
|
||||||
target/llvm-cov/**
|
target/llvm-cov/**
|
||||||
if-no-files-found: warn
|
if-no-files-found: warn
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.PHONY: fmt fmt-check clippy test-local test-debugger-socket clean coverage coverage-xml coverage-json coverage-report-json coverage-domain-list coverage-domain-evidence coverage-domain-audit coverage-domain-gate test ci ci-domains test-quality-gate cobertura
|
.PHONY: fmt fmt-check clippy test-local test-debugger-socket clean coverage coverage-xml coverage-json coverage-report-json coverage-domain-list coverage-domain-evidence coverage-domain-audit coverage-domain-gate test ci ci-domains cobertura
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
cargo fmt --all
|
cargo fmt --all
|
||||||
@@ -47,14 +47,12 @@ coverage-domain-gate:
|
|||||||
./scripts/coverage-domain-evidence.sh --check-all
|
./scripts/coverage-domain-evidence.sh --check-all
|
||||||
|
|
||||||
test: fmt-check clippy test-local test-debugger-socket
|
test: fmt-check clippy test-local test-debugger-socket
|
||||||
# Keep the step list here: CI providers consume the repository contract.
|
# Local and GitHub entry point; Jenkins exposes the same targets as stages.
|
||||||
# The runner executes each step serially even if the caller supplies make -j.
|
CI_DOMAIN_STEPS = clean fmt-check clippy test-local test-debugger-socket coverage coverage-report-json coverage-xml coverage-json coverage-domain-audit coverage-domain-gate
|
||||||
CI_DOMAIN_STEPS = clean fmt-check clippy test-quality-gate test-local test-debugger-socket coverage coverage-report-json coverage-xml coverage-json coverage-domain-audit coverage-domain-gate
|
|
||||||
|
|
||||||
ci: ci-domains
|
ci: ci-domains
|
||||||
ci-domains:
|
ci-domains:
|
||||||
python3 scripts/run-quality-gate.py $(CI_DOMAIN_STEPS)
|
rm -rf target/llvm-cov
|
||||||
|
+@set -e; for step in $(CI_DOMAIN_STEPS); do $(MAKE) --no-print-directory -j1 $$step; done
|
||||||
|
|
||||||
test-quality-gate:
|
|
||||||
python3 -B -m unittest discover -s scripts/tests -p 'test_quality_gate.py'
|
|
||||||
cobertura: coverage-xml coverage-json
|
cobertura: coverage-xml coverage-json
|
||||||
|
|||||||
@@ -145,7 +145,6 @@ This produces:
|
|||||||
- `target/llvm-cov/report.json`
|
- `target/llvm-cov/report.json`
|
||||||
- `target/llvm-cov/summary.json`
|
- `target/llvm-cov/summary.json`
|
||||||
- `target/llvm-cov/cobertura.xml`
|
- `target/llvm-cov/cobertura.xml`
|
||||||
- `target/quality-gate/metadata.json` and per-step logs
|
|
||||||
|
|
||||||
Domain-oriented evidence helpers:
|
Domain-oriented evidence helpers:
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! Shared PBX v1 resource limits and structured validation failures.
|
//! Shared PBX v0 resource limits and structured validation failures.
|
||||||
//! Counters are deterministic; a failed reservation never changes usage.
|
//! Counters are deterministic; a failed reservation never changes usage.
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! Strict PBX v1 envelope and Registry sections. No legacy fallback.
|
//! Strict PBX v0 envelope and Registry sections. No legacy fallback.
|
||||||
//! Envelope parsing is structural only: non-Registry sections and instructions
|
//! Envelope parsing is structural only: non-Registry sections and instructions
|
||||||
//! must be validated by their consumers before an executable image is published.
|
//! must be validated by their consumers before an executable image is published.
|
||||||
use crate::load_limits::{
|
use crate::load_limits::{
|
||||||
@@ -32,7 +32,7 @@ impl<'a> PbxEnvelope<'a> {
|
|||||||
if &bytes[..4] != b"PBX\0" {
|
if &bytes[..4] != b"PBX\0" {
|
||||||
return Err(E::new(C::InvalidFormat, R::Magic));
|
return Err(E::new(C::InvalidFormat, R::Magic));
|
||||||
}
|
}
|
||||||
if bytes[4..6] != [1, 0] {
|
if bytes[4..6] != [0, 0] {
|
||||||
return Err(E::new(C::UnsupportedFormat, R::Version));
|
return Err(E::new(C::UnsupportedFormat, R::Version));
|
||||||
}
|
}
|
||||||
if bytes[6] != 0 {
|
if bytes[6] != 0 {
|
||||||
@@ -314,14 +314,14 @@ impl<'a, 'b> Reader<'a, 'b> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Raw section input for a v1 envelope writer. Non-Registry section bytes must
|
/// Raw section input for a v0 envelope writer. Non-Registry section bytes must
|
||||||
/// come from their own validated writers; this API never invents defaults.
|
/// come from their own validated writers; this API never invents defaults.
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy)]
|
||||||
pub struct SectionData<'a> {
|
pub struct SectionData<'a> {
|
||||||
pub kind: u32,
|
pub kind: u32,
|
||||||
pub bytes: &'a [u8],
|
pub bytes: &'a [u8],
|
||||||
}
|
}
|
||||||
/// Assemble strict v1 sections. The output buffer is charged to temporary load storage.
|
/// Assemble strict v0 sections. The output buffer is charged to temporary load storage.
|
||||||
pub fn encode_envelope(sections: &[SectionData<'_>], b: &mut LoadBudget) -> Result<Vec<u8>, E> {
|
pub fn encode_envelope(sections: &[SectionData<'_>], b: &mut LoadBudget) -> Result<Vec<u8>, E> {
|
||||||
b.transaction(|b| {
|
b.transaction(|b| {
|
||||||
let mut by_kind = [None; 9];
|
let mut by_kind = [None; 9];
|
||||||
@@ -349,7 +349,7 @@ pub fn encode_envelope(sections: &[SectionData<'_>], b: &mut LoadBudget) -> Resu
|
|||||||
b.work(total)?;
|
b.work(total)?;
|
||||||
let mut out = b.vector(total, Q::TemporaryBytes)?;
|
let mut out = b.vector(total, Q::TemporaryBytes)?;
|
||||||
out.extend_from_slice(b"PBX\0");
|
out.extend_from_slice(b"PBX\0");
|
||||||
out.extend_from_slice(&[1, 0, 0, 0]);
|
out.extend_from_slice(&[0, 0, 0, 0]);
|
||||||
out.extend_from_slice(&(count as u32).to_le_bytes());
|
out.extend_from_slice(&(count as u32).to_le_bytes());
|
||||||
out.extend_from_slice(&[0; 20]);
|
out.extend_from_slice(&[0; 20]);
|
||||||
let mut offset = directory_end;
|
let mut offset = directory_end;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use crate::load_limits::IdDomain;
|
|||||||
use crate::model::{ConstantPoolEntry, DebugInfo, Export, SyscallDecl};
|
use crate::model::{ConstantPoolEntry, DebugInfo, Export, SyscallDecl};
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
|
|
||||||
/// Owned, bounded PBX v1 tables for the executable loader. This is not an
|
/// Owned, bounded PBX v0 tables for the executable loader. This is not an
|
||||||
/// executable image: bindings and instruction/type verification are still due.
|
/// executable image: bindings and instruction/type verification are still due.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct OwnedPbx {
|
pub struct OwnedPbx {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//! Producer-side serialization of a complete typed module. This writer emits
|
//! Producer-side serialization of a complete typed module. This writer emits
|
||||||
//! only v1; executable consumers still need bindings and code verification.
|
//! only v0; executable consumers still need bindings and code verification.
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::load_limits::IdDomain;
|
use crate::load_limits::IdDomain;
|
||||||
use crate::model::{ConstantPoolEntry, DebugInfo, Export, SyscallDecl};
|
use crate::model::{ConstantPoolEntry, DebugInfo, Export, SyscallDecl};
|
||||||
|
|||||||
+3
-3
@@ -172,7 +172,7 @@ fn hex(s: &str) -> Vec<u8> {
|
|||||||
// syscalls=168/4, types=172/10, implementations=182/4, captures=186/8. Total=194.
|
// syscalls=168/4, types=172/10, implementations=182/4, captures=186/8. Total=194.
|
||||||
fn minimal_bytes() -> Vec<u8> {
|
fn minimal_bytes() -> Vec<u8> {
|
||||||
hex("
|
hex("
|
||||||
50 42 58 00 01 00 00 00 08 00 00 00
|
50 42 58 00 00 00 00 00 08 00 00 00
|
||||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||||
00 00 00 00 80 00 00 00 04 00 00 00
|
00 00 00 00 80 00 00 00 04 00 00 00
|
||||||
01 00 00 00 84 00 00 00 1e 00 00 00
|
01 00 00 00 84 00 00 00 1e 00 00 00
|
||||||
@@ -241,7 +241,7 @@ fn writer_matches_independent_minimal_envelope() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn owned_v1_decoder_accepts_independent_bytes_without_publishing_an_image() {
|
fn owned_v0_decoder_accepts_independent_bytes_without_publishing_an_image() {
|
||||||
let mut b = budget();
|
let mut b = budget();
|
||||||
let owned = OwnedPbx::parse(&minimal_bytes(), &mut b).unwrap();
|
let owned = OwnedPbx::parse(&minimal_bytes(), &mut b).unwrap();
|
||||||
assert_eq!(owned.registry.declarations(), minimal_registry().declarations());
|
assert_eq!(owned.registry.declarations(), minimal_registry().declarations());
|
||||||
@@ -536,7 +536,7 @@ fn every_truncated_envelope_is_rejected_without_panic() {
|
|||||||
fn envelope_mutations_have_typed_reasons() {
|
fn envelope_mutations_have_typed_reasons() {
|
||||||
for (offset, value, code, reason) in [
|
for (offset, value, code, reason) in [
|
||||||
(0, 0, LoadCode::InvalidFormat, LoadReason::Magic),
|
(0, 0, LoadCode::InvalidFormat, LoadReason::Magic),
|
||||||
(4, 0, LoadCode::UnsupportedFormat, LoadReason::Version),
|
(4, 1, LoadCode::UnsupportedFormat, LoadReason::Version),
|
||||||
(6, 1, LoadCode::InvalidFormat, LoadReason::Endianness),
|
(6, 1, LoadCode::InvalidFormat, LoadReason::Endianness),
|
||||||
(7, 1, LoadCode::InvalidFormat, LoadReason::Reserved),
|
(7, 1, LoadCode::InvalidFormat, LoadReason::Reserved),
|
||||||
(31, 1, LoadCode::InvalidFormat, LoadReason::Reserved),
|
(31, 1, LoadCode::InvalidFormat, LoadReason::Reserved),
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
//! PBX v1 publication: immutable metadata and shared payload, after bindings
|
//! PBX v0 publication: immutable metadata and shared payload, after bindings
|
||||||
//! and bounded whole-program verification. No public unchecked constructor.
|
//! and bounded whole-program verification. No public unchecked constructor.
|
||||||
use crate::string_identity_index::Identity;
|
use crate::string_identity_index::Identity;
|
||||||
use crate::{LoaderPatchError, VmInitError};
|
use crate::{LoaderPatchError, VmInitError};
|
||||||
|
|||||||
@@ -2485,7 +2485,7 @@ mod tests {
|
|||||||
let mut vm = VirtualMachine::default();
|
let mut vm = VirtualMachine::default();
|
||||||
let mut header = vec![0u8; 32];
|
let mut header = vec![0u8; 32];
|
||||||
header[0..4].copy_from_slice(&prometeu_bytecode::PBX_MAGIC);
|
header[0..4].copy_from_slice(&prometeu_bytecode::PBX_MAGIC);
|
||||||
header[4..6].copy_from_slice(&0u16.to_le_bytes()); // retired version
|
header[4..6].copy_from_slice(&1u16.to_le_bytes()); // unsupported version
|
||||||
|
|
||||||
let res = vm.initialize(header);
|
let res = vm.initialize(header);
|
||||||
assert!(
|
assert!(
|
||||||
@@ -2494,11 +2494,11 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_loader_hardening_malformed_pbx_v1() {
|
fn test_loader_hardening_malformed_pbx_v0() {
|
||||||
let mut vm = VirtualMachine::default();
|
let mut vm = VirtualMachine::default();
|
||||||
let mut header = vec![0u8; 32];
|
let mut header = vec![0u8; 32];
|
||||||
header[0..4].copy_from_slice(&prometeu_bytecode::PBX_MAGIC);
|
header[0..4].copy_from_slice(&prometeu_bytecode::PBX_MAGIC);
|
||||||
header[4..6].copy_from_slice(&1u16.to_le_bytes());
|
header[4..6].copy_from_slice(&0u16.to_le_bytes());
|
||||||
header[8..12].copy_from_slice(&1u32.to_le_bytes()); // missing directory
|
header[8..12].copy_from_slice(&1u32.to_le_bytes()); // missing directory
|
||||||
|
|
||||||
let res = vm.initialize(header);
|
let res = vm.initialize(header);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use prometeu_vm::{
|
|||||||
// Independent executable oracle: 32-byte header, eight directory entries,
|
// Independent executable oracle: 32-byte header, eight directory entries,
|
||||||
// payload at 128, one Bool import, one zero-slot HALT function; total 194.
|
// payload at 128, one Bool import, one zero-slot HALT function; total 194.
|
||||||
fn minimal() -> Vec<u8> {
|
fn minimal() -> Vec<u8> {
|
||||||
"50 42 58 00 01 00 00 00 08 00 00 00
|
"50 42 58 00 00 00 00 00 08 00 00 00
|
||||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||||
00 00 00 00 80 00 00 00 04 00 00 00
|
00 00 00 00 80 00 00 00 04 00 00 00
|
||||||
01 00 00 00 84 00 00 00 1e 00 00 00
|
01 00 00 00 84 00 00 00 1e 00 00 00
|
||||||
@@ -46,7 +46,7 @@ impl NativeInterface for Native {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn independent_v1_bytes_load_publish_and_execute_through_the_public_sealed_boundary() {
|
fn independent_v0_bytes_load_publish_and_execute_through_the_public_sealed_boundary() {
|
||||||
let bytes = minimal();
|
let bytes = minimal();
|
||||||
assert_eq!(bytes.len(), 194);
|
assert_eq!(bytes.len(), 194);
|
||||||
let mut load = LoadBudget::new(Default::default());
|
let mut load = LoadBudget::new(Default::default());
|
||||||
@@ -64,7 +64,7 @@ fn independent_v1_bytes_load_publish_and_execute_through_the_public_sealed_bound
|
|||||||
#[test]
|
#[test]
|
||||||
fn single_violation_oracles_reject_before_image_publication_with_typed_context() {
|
fn single_violation_oracles_reject_before_image_publication_with_typed_context() {
|
||||||
for (offset, replacement, code, reason, pc) in [
|
for (offset, replacement, code, reason, pc) in [
|
||||||
(4, 0, LoadCode::UnsupportedFormat, LoadReason::Version, None),
|
(4, 1, LoadCode::UnsupportedFormat, LoadReason::Version, None),
|
||||||
(178, 0, LoadCode::UnsupportedFormat, LoadReason::Builtin, None),
|
(178, 0, LoadCode::UnsupportedFormat, LoadReason::Builtin, None),
|
||||||
(162, 0xff, LoadCode::InvalidCode, LoadReason::UnknownOpcode, Some(0)),
|
(162, 0xff, LoadCode::InvalidCode, LoadReason::UnknownOpcode, Some(0)),
|
||||||
(162, 0x11, LoadCode::InvalidCode, LoadReason::StackUnderflow, Some(0)),
|
(162, 0x11, LoadCode::InvalidCode, LoadReason::StackUnderflow, Some(0)),
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ pub fn build_program() -> Vec<u8> {
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
.serialize(&mut LoadBudget::new(Default::default()))
|
.serialize(&mut LoadBudget::new(Default::default()))
|
||||||
.expect("bounded v1 program")
|
.expect("bounded v0 program")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn manifest_json() -> Vec<u8> {
|
pub fn manifest_json() -> Vec<u8> {
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ pub fn generate() -> Result<()> {
|
|||||||
syscalls: &syscalls,
|
syscalls: &syscalls,
|
||||||
}
|
}
|
||||||
.serialize(&mut LoadBudget::new(Default::default()))
|
.serialize(&mut LoadBudget::new(Default::default()))
|
||||||
.expect("bounded v1 program");
|
.expect("bounded v0 program");
|
||||||
|
|
||||||
let mut out_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
let mut out_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||||
out_dir.pop(); // pbxgen-stress
|
out_dir.pop(); // pbxgen-stress
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ DSC-0052; the workflow scaffolding is disposable, while these explanations and t
|
|||||||
[discussion index](../../index.ndjson) persist.
|
[discussion index](../../index.ndjson) persist.
|
||||||
|
|
||||||
The normative references are [function values and closures](../../../docs/specs/runtime/02b-vm-function-values-and-closures.md),
|
The normative references are [function values and closures](../../../docs/specs/runtime/02b-vm-function-values-and-closures.md),
|
||||||
[Registry and PBX v1](../../../docs/specs/runtime/02c-program-registry-and-pbx-v1.md),
|
[Registry and PBX v1](../../../docs/specs/runtime/02c-program-registry-and-pbx-v0.md),
|
||||||
[frame continuation](../../../docs/specs/runtime/09a-coroutines-and-cooperative-scheduling.md)
|
[frame continuation](../../../docs/specs/runtime/09a-coroutines-and-cooperative-scheduling.md)
|
||||||
and [memory ownership](../../../docs/specs/runtime/03-memory-stack-heap-and-allocation.md).
|
and [memory ownership](../../../docs/specs/runtime/03-memory-stack-heap-and-allocation.md).
|
||||||
The earlier [Registry lesson](../DSC-0058-program-registry-type-and-function-metadata/LSN-0059-registry-boundaries-and-owned-values.md)
|
The earlier [Registry lesson](../DSC-0058-program-registry-type-and-function-metadata/LSN-0059-registry-boundaries-and-owned-values.md)
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ an eight-hour endurance test. This lesson preserves the decision and its revisio
|
|||||||
after workflow cleanup; the [discussion index](../../index.ndjson) tracks closure.
|
after workflow cleanup; the [discussion index](../../index.ndjson) tracks closure.
|
||||||
|
|
||||||
Normative references remain [memory and GC](../../../docs/specs/runtime/03-memory-stack-heap-and-allocation.md),
|
Normative references remain [memory and GC](../../../docs/specs/runtime/03-memory-stack-heap-and-allocation.md),
|
||||||
[Registry/PBX](../../../docs/specs/runtime/02c-program-registry-and-pbx-v1.md),
|
[Registry/PBX](../../../docs/specs/runtime/02c-program-registry-and-pbx-v0.md),
|
||||||
[typed callables](../../../docs/specs/runtime/02b-vm-function-values-and-closures.md)
|
[typed callables](../../../docs/specs/runtime/02b-vm-function-values-and-closures.md)
|
||||||
and [single-context lifecycle](../../../docs/specs/runtime/09a-coroutines-and-cooperative-scheduling.md).
|
and [single-context lifecycle](../../../docs/specs/runtime/09a-coroutines-and-cooperative-scheduling.md).
|
||||||
The [published evidence report](../../../docs/vm-arch/resource-stability-qualification.md)
|
The [published evidence report](../../../docs/vm-arch/resource-stability-qualification.md)
|
||||||
|
|||||||
+2
-2
@@ -16,7 +16,7 @@ closed that delivery. Coordinated production activation was explicitly received
|
|||||||
as future-plan suggestions in AGD-0055. Closing this delivery does not mean the
|
as future-plan suggestions in AGD-0055. Closing this delivery does not mean the
|
||||||
old production loader or version-0 example generators were migrated.
|
old production loader or version-0 example generators were migrated.
|
||||||
|
|
||||||
The normative reference is [Program Registry and PBX v1](../../../docs/specs/runtime/02c-program-registry-and-pbx-v1.md).
|
The normative reference is [Program Registry and PBX v1](../../../docs/specs/runtime/02c-program-registry-and-pbx-v0.md).
|
||||||
The [permanent handoff](../../../docs/vm-arch/registry-producer-handoff.md) records
|
The [permanent handoff](../../../docs/vm-arch/registry-producer-handoff.md) records
|
||||||
delivered APIs, producer oracles and pending integration ownership. This lesson
|
delivered APIs, producer oracles and pending integration ownership. This lesson
|
||||||
explains published mechanisms; it does not define callable/capture policy.
|
explains published mechanisms; it does not define callable/capture policy.
|
||||||
@@ -135,7 +135,7 @@ Synthetic collision keys and work-limit tests complement real-address timings;
|
|||||||
allocator-selected address order is not a stable test oracle across loads.
|
allocator-selected address order is not a stable test oracle across loads.
|
||||||
|
|
||||||
This implementation follows DEC-0065, summarized in the [runtime quality lesson](../DSC-0064-runtime-branch-quality-review/LSN-0070-runtime-quality-needs-independent-oracles-and-owned-evidence.md).
|
This implementation follows DEC-0065, summarized in the [runtime quality lesson](../DSC-0064-runtime-branch-quality-review/LSN-0070-runtime-quality-needs-independent-oracles-and-owned-evidence.md).
|
||||||
The [published ownership contract](../../../docs/specs/runtime/02c-program-registry-and-pbx-v1.md#memory-ownership-and-quotas)
|
The [published ownership contract](../../../docs/specs/runtime/02c-program-registry-and-pbx-v0.md#memory-ownership-and-quotas)
|
||||||
remains normative; native import, snapshot retention and typed storage tests
|
remains normative; native import, snapshot retention and typed storage tests
|
||||||
verify the same owner lifetimes through the new indices.
|
verify the same owner lifetimes through the new indices.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ meaning. A game's local slot index remains stable while physical blocks rotate.
|
|||||||
The historical source was accepted decision DEC-0055, executed through PLN-0186
|
The historical source was accepted decision DEC-0055, executed through PLN-0186
|
||||||
for AGD-0064. Those workflow artifacts are disposable; the normative references
|
for AGD-0064. Those workflow artifacts are disposable; the normative references
|
||||||
are [Save Memory and MEMCARD](../../../docs/specs/runtime/08-save-memory-and-memcard.md),
|
are [Save Memory and MEMCARD](../../../docs/specs/runtime/08-save-memory-and-memcard.md),
|
||||||
[Registry](../../../docs/specs/runtime/02c-program-registry-and-pbx-v1.md),
|
[Registry](../../../docs/specs/runtime/02c-program-registry-and-pbx-v0.md),
|
||||||
[Host ABI](../../../docs/specs/runtime/16-host-abi-and-syscalls.md) and
|
[Host ABI](../../../docs/specs/runtime/16-host-abi-and-syscalls.md) and
|
||||||
[producer handoff](../../../docs/vm-arch/registry-producer-handoff.md).
|
[producer handoff](../../../docs/vm-arch/registry-producer-handoff.md).
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ Optional BeforePause and BeforeResume functions now run around the existing OS
|
|||||||
suspension and reactivation transitions. The implementation derives from accepted
|
suspension and reactivation transitions. The implementation derives from accepted
|
||||||
DEC-0054 and PLN-0185, originating in AGD-0065 / DSC-0062. These workflow records
|
DEC-0054 and PLN-0185, originating in AGD-0065 / DSC-0062. These workflow records
|
||||||
are disposable; the durable contracts are
|
are disposable; the durable contracts are
|
||||||
[Registry roles](../../../docs/specs/runtime/02c-program-registry-and-pbx-v1.md#optional-lifecycle-roles)
|
[Registry roles](../../../docs/specs/runtime/02c-program-registry-and-pbx-v0.md#optional-lifecycle-roles)
|
||||||
and [controlled lifecycle calls](../../../docs/specs/runtime/09a-coroutines-and-cooperative-scheduling.md#controlled-lifecycle-calls).
|
and [controlled lifecycle calls](../../../docs/specs/runtime/09a-coroutines-and-cooperative-scheduling.md#controlled-lifecycle-calls).
|
||||||
|
|
||||||
## Binding Describes a Runtime Event, Not a Frontend Construct
|
## Binding Describes a Runtime Event, Not a Frontend Construct
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@ Recurring VM stack/return work reuses capacity after warmup; release allocator
|
|||||||
checks measure the execution region separately from setup. String provenance uses
|
checks measure the execution region separately from setup. String provenance uses
|
||||||
image and session indices under existing ownership quotas. Index metadata and
|
image and session indices under existing ownership quotas. Index metadata and
|
||||||
construction cost are charged and measured, including collision and refusal paths.
|
construction cost are charged and measured, including collision and refusal paths.
|
||||||
See the [Registry contract](../../../docs/specs/runtime/02c-program-registry-and-pbx-v1.md)
|
See the [Registry contract](../../../docs/specs/runtime/02c-program-registry-and-pbx-v0.md)
|
||||||
and [provenance qualification](../../../docs/vm-arch/string-provenance-qualification.md).
|
and [provenance qualification](../../../docs/vm-arch/string-provenance-qualification.md).
|
||||||
Lookup improvements do not establish faster game frames or cheaper construction.
|
Lookup improvements do not establish faster game frames or cheaper construction.
|
||||||
|
|
||||||
|
|||||||
@@ -160,9 +160,9 @@ Primary cause:
|
|||||||
enemy.updateAI(): 1,012 cycles
|
enemy.updateAI(): 1,012 cycles
|
||||||
```
|
```
|
||||||
|
|
||||||
## Program Registry v1 integration
|
## Program Registry integration
|
||||||
|
|
||||||
The [Dynamic/reference instruction table](02c-program-registry-and-pbx-v1.md#dynamic-and-reference-instructions) specifies fixed costs of 8/4/3/4/4/5/4 cycles for opcodes 0x0090–0x0096. Each decoded attempt charges once, including a trap. Input retains the existing one-cycle INTRINSIC rule. Load work quotas are deterministic analysis units, not execution cycles or a wall-clock timeout.
|
The [Dynamic/reference instruction table](02c-program-registry-and-pbx-v0.md#dynamic-and-reference-instructions) specifies fixed costs of 8/4/3/4/4/5/4 cycles for opcodes 0x0090–0x0096. Each decoded attempt charges once, including a trap. Input retains the existing one-cycle INTRINSIC rule. Load work quotas are deterministic analysis units, not execution cycles or a wall-clock timeout.
|
||||||
|
|
||||||
|
|
||||||
## Collection Attempt Charging
|
## Collection Attempt Charging
|
||||||
|
|||||||
@@ -129,9 +129,9 @@ The PVM is:
|
|||||||
- single execution context; retired SPAWN/YIELD/SLEEP are rejected;
|
- single execution context; retired SPAWN/YIELD/SLEEP are rejected;
|
||||||
- embedded inside the larger PROMETEU console model, not equal to it.
|
- embedded inside the larger PROMETEU console model, not equal to it.
|
||||||
|
|
||||||
## Program Registry v1 integration
|
## Program Registry integration
|
||||||
|
|
||||||
[Program Registry and PBX v1](02c-program-registry-and-pbx-v1.md) defines typed immediate domains, opcodes 0x0090–0x0096, complete multi-slot groups and conservative type-flow verification. Unknown facts require runtime validation and do not alone reject an otherwise valid join. Opcode bytes remain u16; TypeId immediates are u32 little-endian.
|
[Program Registry and PBX v0](02c-program-registry-and-pbx-v0.md) defines typed immediate domains, opcodes 0x0090–0x0096, complete multi-slot groups and conservative type-flow verification. Unknown facts require runtime validation and do not alone reject an otherwise valid join. Opcode bytes remain u16; TypeId immediates are u32 little-endian.
|
||||||
|
|
||||||
|
|
||||||
## Typed Collection Instructions
|
## Typed Collection Instructions
|
||||||
@@ -154,7 +154,7 @@ STRUCT operations require a Struct descriptor; ARRAY operations require an Array
|
|||||||
|
|
||||||
After charging the attempt, incomplete temporary operands trap with STACK_UNDERFLOW. Instance operations check receiver carrier, absence, liveness/generation, category, Registry and exact TypeId first; array access then checks exact Int64 index and bounds; SET checks the complete value group last. There is no numeric, Trait or Dynamic coercion. Negative lengths or indices and indices at/above length trap with OOB (0x03); wrong carriers/types/groups trap with TYPE (0x04); absent receivers with NULL_REFERENCE (0x0E); invalid/dead/stale handles with INVALID_HANDLE (0x0F). Positive lengths above u32, checked size/cost overflow, resource quotas and recoverable allocation failures trap with RESOURCE_LIMIT (0x10), preserving resource reason/requested/limit. Static invalid TypeIds/categories/fields produce LOAD_INVALID_REFERENCE; proven stack/type conflicts produce LOAD_INVALID_CODE. Runtime TrapInfo preserves the attempted PC, opcode and available source span.
|
After charging the attempt, incomplete temporary operands trap with STACK_UNDERFLOW. Instance operations check receiver carrier, absence, liveness/generation, category, Registry and exact TypeId first; array access then checks exact Int64 index and bounds; SET checks the complete value group last. There is no numeric, Trait or Dynamic coercion. Negative lengths or indices and indices at/above length trap with OOB (0x03); wrong carriers/types/groups trap with TYPE (0x04); absent receivers with NULL_REFERENCE (0x0E); invalid/dead/stale handles with INVALID_HANDLE (0x0F). Positive lengths above u32, checked size/cost overflow, resource quotas and recoverable allocation failures trap with RESOURCE_LIMIT (0x10), preserving resource reason/requested/limit. Static invalid TypeIds/categories/fields produce LOAD_INVALID_REFERENCE; proven stack/type conflicts produce LOAD_INVALID_CODE. Runtime TrapInfo preserves the attempted PC, opcode and available source span.
|
||||||
|
|
||||||
Publication and ownership follow [typed collection memory](03-memory-stack-heap-and-allocation.md); charging follows [time and cycles](01-time-model-and-cycles.md). See the [producer handoff](../../vm-arch/collection-producer-handoff.md) for independent byte oracles and construction examples. Production consumers must enter through the validated PBX v1 image boundary described in [Program Registry](02c-program-registry-and-pbx-v1.md).
|
Publication and ownership follow [typed collection memory](03-memory-stack-heap-and-allocation.md); charging follows [time and cycles](01-time-model-and-cycles.md). See the [producer handoff](../../vm-arch/collection-producer-handoff.md) for independent byte oracles and construction examples. Production consumers must enter through the validated PBX v0 image boundary described in [Program Registry](02c-program-registry-and-pbx-v0.md).
|
||||||
|
|
||||||
Typed callable instructions are MAKE_CLOSURE `(FunctionId,FnTypeId)`, CALL_CLOSURE `(FnTypeId)`, GET_CAPTURE `(index)` and CALL_TRAIT `(TraitTypeId,method_index)`. Their groups, encodings and attempted costs are defined in the [Fn contract](02b-vm-function-values-and-closures.md). Numbers 0x54–0x56 stay reserved and reject anywhere at load.
|
Typed callable instructions are MAKE_CLOSURE `(FunctionId,FnTypeId)`, CALL_CLOSURE `(FnTypeId)`, GET_CAPTURE `(index)` and CALL_TRAIT `(TraitTypeId,method_index)`. Their groups, encodings and attempted costs are defined in the [Fn contract](02b-vm-function-values-and-closures.md). Numbers 0x54–0x56 stay reserved and reject anywhere at load.
|
||||||
|
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ Verifier decodes every function range, validates instruction boundaries/IDs/jump
|
|||||||
Use a bounded worklist to fixed point, reprocessing widened states; decide state-dependent type errors after convergence so visitation order cannot cause rejection. Signature contracts suffice for calls; no interprocedural body inference is required. Partial group mutation invalidates relational facts. Unknown is not proof of compatibility and does not alone reject code: retain complete runtime checks. Type knowledge alone does not eliminate null/generation/bounds checks. CALL_CLOSURE uses expected FnTypeId to establish parameter/result groups even for unknown concrete targets. GET_CAPTURE accesses typed metadata of the enclosing function; environment is retained by CallFrame without hidden arg0. Known mismatch rejects, Unknown retains runtime checks. Exceeding memory/work budget rejects loading, never skips verification.
|
Use a bounded worklist to fixed point, reprocessing widened states; decide state-dependent type errors after convergence so visitation order cannot cause rejection. Signature contracts suffice for calls; no interprocedural body inference is required. Partial group mutation invalidates relational facts. Unknown is not proof of compatibility and does not alone reject code: retain complete runtime checks. Type knowledge alone does not eliminate null/generation/bounds checks. CALL_CLOSURE uses expected FnTypeId to establish parameter/result groups even for unknown concrete targets. GET_CAPTURE accesses typed metadata of the enclosing function; environment is retained by CallFrame without hidden arg0. Known mismatch rejects, Unknown retains runtime checks. Exceeding memory/work budget rejects loading, never skips verification.
|
||||||
|
|
||||||
|
|
||||||
Builtin IDs, exact slot carriers, nullable defaults and stored layouts are defined in [Program Registry and PBX v1](02c-program-registry-and-pbx-v1.md#values-storage-and-initialization). A fixed list of results does not imply a tuple object or boxing. Parameter names are optional signature metadata; frontend argument reordering must preserve source evaluation order.
|
Builtin IDs, exact slot carriers, nullable defaults and stored layouts are defined in [Program Registry and PBX v0](02c-program-registry-and-pbx-v0.md#values-storage-and-initialization). A fixed list of results does not imply a tuple object or boxing. Parameter names are optional signature metadata; frontend argument reordering must preserve source evaluation order.
|
||||||
|
|
||||||
## Finite Float and explicit math conversions
|
## Finite Float and explicit math conversions
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ private typed Struct cells with ordinary field operations, common to creator and
|
|||||||
closures. Another factory can allocate another cell. No Cell category or
|
closures. Another factory can allocate another cell. No Cell category or
|
||||||
SET_CAPTURE is introduced; language lowering belongs to each frontend.
|
SET_CAPTURE is introduced; language lowering belongs to each frontend.
|
||||||
|
|
||||||
PBX v1 MUST include exactly one captures section, kind 8: little-endian
|
PBX v0 MUST include exactly one captures section, kind 8: little-endian
|
||||||
`function_count:u32`, then per FunctionId `capture_count:u32` and ordered capture
|
`function_count:u32`, then per FunctionId `capture_count:u32` and ordered capture
|
||||||
TypeIds:u32. Outer count equals the function table; empty lists are explicit.
|
TypeIds:u32. Outer count equals the function table; empty lists are explicit.
|
||||||
Offsets/widths/maps derive at load. Records, capacities and graph work use existing
|
Offsets/widths/maps derive at load. Records, capacities and graph work use existing
|
||||||
@@ -99,7 +99,7 @@ Optional SystemOS lifecycle entry uses Registry roles and the controlled boundar
|
|||||||
described below; it does not introduce arbitrary native reentry.
|
described below; it does not introduce arbitrary native reentry.
|
||||||
|
|
||||||
See [memory](03-memory-stack-heap-and-allocation.md),
|
See [memory](03-memory-stack-heap-and-allocation.md),
|
||||||
[Registry/PBX](02c-program-registry-and-pbx-v1.md) and
|
[Registry/PBX](02c-program-registry-and-pbx-v0.md) and
|
||||||
[host ABI](16-host-abi-and-syscalls.md).
|
[host ABI](16-host-abi-and-syscalls.md).
|
||||||
|
|
||||||
## Random core integration
|
## Random core integration
|
||||||
@@ -109,7 +109,7 @@ See [memory](03-memory-stack-heap-and-allocation.md),
|
|||||||
## System-owned lifecycle entry
|
## System-owned lifecycle entry
|
||||||
|
|
||||||
Optional zero-argument, zero-result, capture-free lifecycle targets are bound by
|
Optional zero-argument, zero-result, capture-free lifecycle targets are bound by
|
||||||
[Registry roles](02c-program-registry-and-pbx-v1.md#optional-lifecycle-roles).
|
[Registry roles](02c-program-registry-and-pbx-v0.md#optional-lifecycle-roles).
|
||||||
They are ordinary functions called through a controlled SystemOS boundary, not
|
They are ordinary functions called through a controlled SystemOS boundary, not
|
||||||
closure values or replacement boot entries. The boundary retains the existing
|
closure values or replacement boot entries. The boundary retains the existing
|
||||||
stacks and roots, appends its frame, and returns to SystemOS immediately on outer
|
stacks and roots, appends its frame, and returns to SystemOS immediately on outer
|
||||||
|
|||||||
+9
-7
@@ -1,9 +1,9 @@
|
|||||||
# Program Registry, Typed Values and PBX v1
|
# Program Registry, Typed Values and PBX v0
|
||||||
|
|
||||||
Domain: VM program metadata, binary format, typed storage and resource boundaries
|
Domain: VM program metadata, binary format, typed storage and resource boundaries
|
||||||
Function: normative
|
Function: normative
|
||||||
|
|
||||||
The production loader, internal producers and runtime examples use this sealed v1 contract. Typed Fn and frame environments follow [the function-value contract](02b-vm-function-values-and-closures.md); retired coroutine instructions reject at load. No provisional untyped reference is authorized.
|
The production loader, internal producers and runtime examples use this sealed v0 contract. Typed Fn and frame environments follow [the function-value contract](02b-vm-function-values-and-closures.md); retired coroutine instructions reject at load. No provisional untyped reference is authorized.
|
||||||
|
|
||||||
Didactic companion: [Registry Boundaries and Owned Values](../../../discussion/lessons/DSC-0058-program-registry-type-and-function-metadata/LSN-0059-registry-boundaries-and-owned-values.md).
|
Didactic companion: [Registry Boundaries and Owned Values](../../../discussion/lessons/DSC-0058-program-registry-type-and-function-metadata/LSN-0059-registry-boundaries-and-owned-values.md).
|
||||||
|
|
||||||
@@ -21,9 +21,11 @@ The requirements below use MUST/MUST NOT semantics. The Registry owns type/funct
|
|||||||
- Parameter names are optional signature metadata independent of debug. Frontends reorder named arguments to signature order while preserving source evaluation order, using temporaries. Mixing/default-argument syntax and diagnostics stay with frontends; optional/default parameters are not implicitly introduced.
|
- Parameter names are optional signature metadata independent of debug. Frontends reorder named arguments to signature order while preserving source evaluation order, using temporaries. Mixing/default-argument syntax and diagnostics stay with frontends; optional/default parameters are not implicitly introduced.
|
||||||
- Trait implementations are unique per (Struct, Trait), complete, immutable and ordered by method index. Explicit parameter/result TypeIds, order and arity match exactly; the implementation function has its concrete receiver as first parameter. No variance or implicit adaptation: frontend adapter functions may satisfy the exact signature. CALL_TRAIT resolves TraitTypeId/method index through this immutable table; targets have empty captures and receive concrete receiver first, never ImplementationId as an argument.
|
- Trait implementations are unique per (Struct, Trait), complete, immutable and ordered by method index. Explicit parameter/result TypeIds, order and arity match exactly; the implementation function has its concrete receiver as first parameter. No variance or implicit adaptation: frontend adapter functions may satisfy the exact signature. CALL_TRAIT resolves TraitTypeId/method index through this immutable table; targets have empty captures and receive concrete receiver first, never ImplementationId as an argument.
|
||||||
|
|
||||||
## PBX v1 encoding
|
## PBX v0 encoding
|
||||||
|
|
||||||
PBX v1 only: magic `PBX\0`, little-endian, 32-byte header, zero reserved bytes and directory triples `(kind:u32, offset:u32, length:u32)`. Preserve existing non-Registry section encodings except expressly required changes. Reject unsupported versions, unknown/duplicate/missing sections, overlap, overflow, truncation and trailing table bytes. Section Code is raw instructions without a count prefix.
|
The format remains in development at version 0; changes to the current schema do not imply a version bump or compatibility with earlier development layouts.
|
||||||
|
|
||||||
|
PBX v0 only (u16 version at offset 4 MUST be zero): magic `PBX\0`, little-endian, 32-byte header, zero reserved bytes and directory triples `(kind:u32, offset:u32, length:u32)`. Preserve existing non-Registry section encodings except expressly required changes. Reject unsupported versions, unknown/duplicate/missing sections, overlap, overflow, truncation and trailing table bytes. Section Code is raw instructions without a count prefix.
|
||||||
|
|
||||||
| Kind | Section | Presence |
|
| Kind | Section | Presence |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
@@ -42,7 +44,7 @@ The fixed header is:
|
|||||||
| Byte offset | Encoding | Meaning |
|
| Byte offset | Encoding | Meaning |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| 0 | four bytes | `PBX\0` |
|
| 0 | four bytes | `PBX\0` |
|
||||||
| 4 | u16 | version 1 |
|
| 4 | u16 | version 0 |
|
||||||
| 6 | u8 | endianness 0 (little-endian) |
|
| 6 | u8 | endianness 0 (little-endian) |
|
||||||
| 7 | u8 | reserved, zero |
|
| 7 | u8 | reserved, zero |
|
||||||
| 8 | u32 | section count |
|
| 8 | u32 | section count |
|
||||||
@@ -103,7 +105,7 @@ are not the binding mechanism.
|
|||||||
Pause/resume hooks may be absent. MemcardBoot is required for a cartridge with
|
Pause/resume hooks may be absent. MemcardBoot is required for a cartridge with
|
||||||
the memcard capability and is invoked only at its explicit bootstrap gate.
|
the memcard capability and is invoked only at its explicit bootstrap gate.
|
||||||
Additional roles require a future contract; there is
|
Additional roles require a future contract; there is
|
||||||
no termination role. PBX remains version 1, with no old-layout fallback or
|
no termination role. PBX remains version 0, with no old-layout fallback or
|
||||||
external-artifact compatibility. Producers MUST regenerate their images and
|
external-artifact compatibility. Producers MUST regenerate their images and
|
||||||
emit this byte for every function, including zero for ordinary functions.
|
emit this byte for every function, including zero for ordinary functions.
|
||||||
Frontend compilers choose their own source syntax and lower it to these roles.
|
Frontend compilers choose their own source syntax and lower it to these roles.
|
||||||
@@ -303,4 +305,4 @@ precedence, conversions, catalog metadata and producer examples.
|
|||||||
|
|
||||||
## Random core integration
|
## Random core integration
|
||||||
|
|
||||||
[Random](02e-vm-owned-random-core.md) adds BuiltinId 0x0016 and intrinsic IDs 0x4000–0x4003 using existing PBX v1 encoding. Registry categories remain unchanged; unsupported identities are rejected, without fallback.
|
[Random](02e-vm-owned-random-core.md) adds BuiltinId 0x0016 and intrinsic IDs 0x4000–0x4003 using existing PBX v0 encoding. Registry categories remain unchanged; unsupported identities are rejected, without fallback.
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
It occupies one execution slot: present values use `Value::HeapRef`; the default
|
It occupies one execution slot: present values use `Value::HeapRef`; the default
|
||||||
is `Value::Null`. Typed storage uses index:u32 and generation:u32, eight bytes
|
is `Value::Null`. Typed storage uses index:u32 and generation:u32, eight bytes
|
||||||
aligned to eight, with GuestReference ownership. Registry categories remain
|
aligned to eight, with GuestReference ownership. Registry categories remain
|
||||||
Builtin, Struct, Array, Trait and Fn. PBX v1 encoding is unchanged.
|
Builtin, Struct, Array, Trait and Fn. PBX v0 encoding is unchanged.
|
||||||
|
|
||||||
ObjectKind::Random has tag 9; DynamicBox remains 8 and tag 6 remains reserved.
|
ObjectKind::Random has tag 9; DynamicBox remains 8 and tag 6 remains reserved.
|
||||||
Its private logical payload is State:u128 and Inc:u128, 32 bytes with no child
|
Its private logical payload is State:u128 and Inc:u128, 32 bytes with no child
|
||||||
@@ -131,7 +131,7 @@ generator state and prior owners, releases provisional resources and publishes
|
|||||||
no partial handle. range draws on private candidate state and rolls it back
|
no partial handle. range draws on private candidate state and rolls it back
|
||||||
on any fault, including the rejection limit. Executed cycles are not refunded.
|
on any fault, including the rejection limit. Executed cycles are not refunded.
|
||||||
|
|
||||||
Loader/verifier recognize Random and all signatures without changing PBX v1.
|
Loader/verifier recognize Random and all signatures without changing PBX v0.
|
||||||
Unknown intrinsic IDs, including unreachable ones, use LOAD_INVALID_CODE/NativeId;
|
Unknown intrinsic IDs, including unreachable ones, use LOAD_INVALID_CODE/NativeId;
|
||||||
runtime INVALID_INTRINSIC is invariant defense. Invalid Registry IDs/signatures
|
runtime INVALID_INTRINSIC is invariant defense. Invalid Registry IDs/signatures
|
||||||
retain existing categories. Unknown type analysis requires full runtime checks.
|
retain existing categories. Unknown type analysis requires full runtime checks.
|
||||||
@@ -161,7 +161,7 @@ claim unexecuted host comparisons. CPU benchmarks do not set virtual costs.
|
|||||||
Frontend and reference-game integration consume the published contract through
|
Frontend and reference-game integration consume the published contract through
|
||||||
separate handoffs. Local core completion does not require those implementations
|
separate handoffs. Local core completion does not require those implementations
|
||||||
or acquisition of hardware. See [numeric semantics](02d-gameplay-math-and-numeric-semantics.md),
|
or acquisition of hardware. See [numeric semantics](02d-gameplay-math-and-numeric-semantics.md),
|
||||||
[Registry/PBX](02c-program-registry-and-pbx-v1.md),
|
[Registry/PBX](02c-program-registry-and-pbx-v0.md),
|
||||||
[memory](03-memory-stack-heap-and-allocation.md) and
|
[memory](03-memory-stack-heap-and-allocation.md) and
|
||||||
[cycles](01-time-model-and-cycles.md).
|
[cycles](01-time-model-and-cycles.md).
|
||||||
|
|
||||||
|
|||||||
@@ -199,9 +199,9 @@ Any violation results in a trap or rejected program image.
|
|||||||
- [`08-save-memory-and-memcard.md`](08-save-memory-and-memcard.md) defines save storage outside VM heap ownership.
|
- [`08-save-memory-and-memcard.md`](08-save-memory-and-memcard.md) defines save storage outside VM heap ownership.
|
||||||
- [`16a-syscall-policies.md`](16a-syscall-policies.md) defines host-root rules and host/heap interaction policy.
|
- [`16a-syscall-policies.md`](16a-syscall-policies.md) defines host-root rules and host/heap interaction policy.
|
||||||
|
|
||||||
## Program Registry v1 integration
|
## Program Registry integration
|
||||||
|
|
||||||
[Program Registry and PBX v1](02c-program-registry-and-pbx-v1.md#values-storage-and-initialization) specifies compact typed layouts, defaults, native String/Dynamic ownership and generational handles. Its [memory quotas](02c-program-registry-and-pbx-v1.md#memory-ownership-and-quotas) apply jointly before allocation. Registry metadata is immutable image-owned native memory, outside guest GC. Stack/local execution retains Value.
|
[Program Registry and PBX v0](02c-program-registry-and-pbx-v0.md#values-storage-and-initialization) specifies compact typed layouts, defaults, native String/Dynamic ownership and generational handles. Its [memory quotas](02c-program-registry-and-pbx-v0.md#memory-ownership-and-quotas) apply jointly before allocation. Registry metadata is immutable image-owned native memory, outside guest GC. Stack/local execution retains Value.
|
||||||
|
|
||||||
|
|
||||||
## Typed Array and Struct Storage
|
## Typed Array and Struct Storage
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ Input.pad().up().hold()
|
|||||||
Input.touch().x()
|
Input.touch().x()
|
||||||
```
|
```
|
||||||
|
|
||||||
Source syntax MUST lower directly to one fixed zero-argument query; pad/touch/button are catalogue prefixes, not guest values. Endpoints cannot be stored or passed, even transiently. The complete 54-query table and removed IDs are specified in [Program Registry input](02c-program-registry-and-pbx-v1.md#input). Unknown IDs are invalid intrinsics; a known unavailable query raises TRAP_UNAVAILABLE (0x11), never a fabricated false/zero.
|
Source syntax MUST lower directly to one fixed zero-argument query; pad/touch/button are catalogue prefixes, not guest values. Endpoints cannot be stored or passed, even transiently. The complete 54-query table and removed IDs are specified in [Program Registry input](02c-program-registry-and-pbx-v0.md#input). Unknown IDs are invalid intrinsics; a known unavailable query raises TRAP_UNAVAILABLE (0x11), never a fabricated false/zero.
|
||||||
|
|
||||||
## 6 Determinism and Replay
|
## 6 Determinism and Replay
|
||||||
|
|
||||||
|
|||||||
@@ -172,4 +172,4 @@ Every PROMETEU game that uses TOUCH:
|
|||||||
|
|
||||||
## Fixed query catalogue
|
## Fixed query catalogue
|
||||||
|
|
||||||
Touch button queries occupy 0x2130–0x2133 (pressed/released/down/hold); x/y use 0x2134/0x2135. All have zero arguments and read the frame snapshot. Button states return Bool; hold and coordinates return Int64. See the [complete input contract](02c-program-registry-and-pbx-v1.md#input).
|
Touch button queries occupy 0x2130–0x2133 (pressed/released/down/hold); x/y use 0x2134/0x2135. All have zero arguments and read the frame snapshot. Button states return Bool; hold and coordinates return Int64. See the [complete input contract](02c-program-registry-and-pbx-v0.md#input).
|
||||||
|
|||||||
@@ -352,6 +352,6 @@ All machine diagnostics and profiling data:
|
|||||||
- do not require a guest-visible debug ABI;
|
- do not require a guest-visible debug ABI;
|
||||||
- are consistent regardless of whether host diagnostics are active or not.
|
- are consistent regardless of whether host diagnostics are active or not.
|
||||||
|
|
||||||
## Program Registry v1 integration
|
## Program Registry integration
|
||||||
|
|
||||||
Loader diagnostics MUST preserve the [structured load tags, reasons and context](02c-program-registry-and-pbx-v1.md#errors-and-publication). Signature names remain available independently of debug data; names do not establish identity. Tools must distinguish image Registry, guest heap, native strings, auxiliary execution state and temporary quotas rather than reporting their sum as RSS.
|
Loader diagnostics MUST preserve the [structured load tags, reasons and context](02c-program-registry-and-pbx-v0.md#errors-and-publication). Signature names remain available independently of debug data; names do not establish identity. Tools must distinguish image Registry, guest heap, native strings, auxiliary execution state and temporary quotas rather than reporting their sum as RSS.
|
||||||
|
|||||||
@@ -175,8 +175,8 @@ structured faults, progress on partial failure and retained desktop run/debug.
|
|||||||
Neither Studio UI nor an AI model is required. See `tests/automation_process.rs`
|
Neither Studio UI nor an AI model is required. See `tests/automation_process.rs`
|
||||||
in prometeu-cli and the in-process deterministic-control tests in the headless crate.
|
in prometeu-cli and the in-process deterministic-control tests in the headless crate.
|
||||||
|
|
||||||
## Program Registry v1 integration
|
## Program Registry integration
|
||||||
|
|
||||||
When exposing initialization failures, retain the [structured load error](02c-program-registry-and-pbx-v1.md#errors-and-publication) code, typed reason and available context. Human-readable messages are not a parsing contract; a load error has no fabricated runtime PC. Failed loads must not publish executable sessions. Existing protocol request names and transport behavior are unchanged.
|
When exposing initialization failures, retain the [structured load error](02c-program-registry-and-pbx-v0.md#errors-and-publication) code, typed reason and available context. Human-readable messages are not a parsing contract; a load error has no fabricated runtime PC. Failed loads must not publish executable sessions. Existing protocol request names and transport behavior are unchanged.
|
||||||
|
|
||||||
Heap reference inspection values use `{"kind":"heap_ref","value":{"index":u32,"generation":u32}}`. Both components are required to distinguish a live incarnation from a reused slot; the wire representation must not truncate handles to indices. Inspection does not grant cross-session transfer authority.
|
Heap reference inspection values use `{"kind":"heap_ref","value":{"index":u32,"generation":u32}}`. Both components are required to distinguish a live incarnation from a reused slot; the wire representation must not truncate handles to indices. Inspection does not grant cross-session transfer authority.
|
||||||
|
|||||||
@@ -229,9 +229,9 @@ The cartridge spec therefore distinguishes:
|
|||||||
- [`14-boot-profiles.md`](14-boot-profiles.md) defines cartridge selection at boot.
|
- [`14-boot-profiles.md`](14-boot-profiles.md) defines cartridge selection at boot.
|
||||||
- [`15-asset-management.md`](15-asset-management.md) defines the `assets.pa` envelope, asset table semantics, preload lifecycle, and residency semantics.
|
- [`15-asset-management.md`](15-asset-management.md) defines the `assets.pa` envelope, asset table semantics, preload lifecycle, and residency semantics.
|
||||||
|
|
||||||
## Program Registry v1 integration
|
## Program Registry integration
|
||||||
|
|
||||||
Program payloads MUST use the PBX v1 envelope and mandatory sections defined in [Program Registry and PBX v1](02c-program-registry-and-pbx-v1.md#pbx-v1-encoding). The file limit is 64 MiB and Code is limited to 32 MiB. Unsupported versions are rejected; runtime examples are regenerated rather than converted by a compatibility loader. The existing func_id = 0 boot authority is unchanged.
|
Program payloads MUST use the PBX v0 envelope and mandatory sections defined in [Program Registry and PBX v0](02c-program-registry-and-pbx-v0.md#pbx-v0-encoding). The file limit is 64 MiB and Code is limited to 32 MiB. Unsupported versions are rejected; runtime examples are regenerated rather than converted by a compatibility loader. The existing func_id = 0 boot authority is unchanged.
|
||||||
|
|
||||||
## Fn Execution Boundary
|
## Fn Execution Boundary
|
||||||
|
|
||||||
|
|||||||
@@ -372,9 +372,9 @@ Only user-defined functions and closures are first-class.
|
|||||||
- [`08-save-memory-and-memcard.md`](08-save-memory-and-memcard.md) defines persistent save-domain semantics.
|
- [`08-save-memory-and-memcard.md`](08-save-memory-and-memcard.md) defines persistent save-domain semantics.
|
||||||
- [`02a-vm-values-and-calling-convention.md`](02a-vm-values-and-calling-convention.md) defines the slot/call philosophy reused by the syscall ABI.
|
- [`02a-vm-values-and-calling-convention.md`](02a-vm-values-and-calling-convention.md) defines the slot/call philosophy reused by the syscall ABI.
|
||||||
|
|
||||||
## Program Registry v1 integration
|
## Program Registry integration
|
||||||
|
|
||||||
Native boundaries MUST respect the [Registry typed-value and ownership contract](02c-program-registry-and-pbx-v1.md): exact carriers and complete groups, generational reference validation, string provenance and preallocation quotas. Existing SYSC binding errors remain structured and separate from Registry errors. Input consists of 54 VM-owned fixed queries, never endpoint objects or host syscalls.
|
Native boundaries MUST respect the [Registry typed-value and ownership contract](02c-program-registry-and-pbx-v0.md): exact carriers and complete groups, generational reference validation, string provenance and preallocation quotas. Existing SYSC binding errors remain structured and separate from Registry errors. Input consists of 54 VM-owned fixed queries, never endpoint objects or host syscalls.
|
||||||
|
|
||||||
## Fn Execution Boundary
|
## Fn Execution Boundary
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ In the current state, no chapter under the active `docs/specs/runtime/` root is
|
|||||||
| [`02-vm-instruction-set.md`](02-vm-instruction-set.md) | VM subsystem overview | normative |
|
| [`02-vm-instruction-set.md`](02-vm-instruction-set.md) | VM subsystem overview | normative |
|
||||||
| [`02a-vm-values-and-calling-convention.md`](02a-vm-values-and-calling-convention.md) | VM values and calling convention | normative |
|
| [`02a-vm-values-and-calling-convention.md`](02a-vm-values-and-calling-convention.md) | VM values and calling convention | normative |
|
||||||
| [`02b-vm-function-values-and-closures.md`](02b-vm-function-values-and-closures.md) | VM closures and function values | normative |
|
| [`02b-vm-function-values-and-closures.md`](02b-vm-function-values-and-closures.md) | VM closures and function values | normative |
|
||||||
| [`02c-program-registry-and-pbx-v1.md`](02c-program-registry-and-pbx-v1.md) | Registry, typed storage, PBX v1 and quotas | normative |
|
| [`02c-program-registry-and-pbx-v0.md`](02c-program-registry-and-pbx-v0.md) | Registry, typed storage, PBX v0 and quotas | normative |
|
||||||
| [02d-gameplay-math-and-numeric-semantics.md](02d-gameplay-math-and-numeric-semantics.md) | VM math, numeric faults, cycles and consumer examples | normative |
|
| [02d-gameplay-math-and-numeric-semantics.md](02d-gameplay-math-and-numeric-semantics.md) | VM math, numeric faults, cycles and consumer examples | normative |
|
||||||
| [`03-memory-stack-heap-and-allocation.md`](03-memory-stack-heap-and-allocation.md) | VM memory model | normative |
|
| [`03-memory-stack-heap-and-allocation.md`](03-memory-stack-heap-and-allocation.md) | VM memory model | normative |
|
||||||
| [`04-gfx-peripheral.md`](04-gfx-peripheral.md) | virtual hardware: graphics | normative |
|
| [`04-gfx-peripheral.md`](04-gfx-peripheral.md) | virtual hardware: graphics | normative |
|
||||||
|
|||||||
@@ -193,9 +193,9 @@ The verifier statically checks bytecode for structural safety and stack‑shape
|
|||||||
- When adding new opcodes or object kinds, extend the verifier and GC traversal accordingly (children enumeration, environment scanning, root sets).
|
- When adding new opcodes or object kinds, extend the verifier and GC traversal accordingly (children enumeration, environment scanning, root sets).
|
||||||
- Update this document alongside any architectural change that affects runtime invariants.
|
- Update this document alongside any architectural change that affects runtime invariants.
|
||||||
|
|
||||||
## Program Registry v1
|
## Program Registry
|
||||||
|
|
||||||
The [Program Registry contract](../specs/runtime/02c-program-registry-and-pbx-v1.md) defines immutable image-owned Type/Function metadata linked by dense IDs. Descriptors are native metadata outside guest GC; nominal identity does not depend on names. Stack/local execution retains Value, while typed storage uses resolved aligned layouts. PBX v1 is the sole target format; publication requires full bounded validation. Fn tag 4 and mandatory captures section 8 extend the Registry; no old-schema fallback is permitted.
|
The [Program Registry contract](../specs/runtime/02c-program-registry-and-pbx-v0.md) defines immutable image-owned Type/Function metadata linked by dense IDs. Descriptors are native metadata outside guest GC; nominal identity does not depend on names. Stack/local execution retains Value, while typed storage uses resolved aligned layouts. PBX v0 is the sole target format; publication requires full bounded validation. Fn tag 4 and mandatory captures section 8 extend the Registry; no old-schema fallback is permitted.
|
||||||
|
|
||||||
`ValidatedProgramImage::load` publishes a shared image only after bounded decoding, native binding and Registry verification; `VirtualMachine::from_image` creates sessions that consume its typed signatures, constants and conversion instructions. Production and internal generators must use this sole sealed-v1 path. Typed Fn integration and legacy removal are implemented together; publication alone is not proof that every consumer has migrated. [Registry Boundaries and Owned Values](../../discussion/lessons/DSC-0058-program-registry-type-and-function-metadata/LSN-0059-registry-boundaries-and-owned-values.md) explains the published mechanisms. The [producer handoff](registry-producer-handoff.md) documents schema, input IDs and named-argument order, while [layout evidence](registry-layout-evidence.md) records reproducible load/access/GC measurements and the current publication boundary.
|
`ValidatedProgramImage::load` publishes a shared image only after bounded decoding, native binding and Registry verification; `VirtualMachine::from_image` creates sessions that consume its typed signatures, constants and conversion instructions. Production and internal generators must use this sole sealed-v1 path. Typed Fn integration and legacy removal are implemented together; publication alone is not proof that every consumer has migrated. [Registry Boundaries and Owned Values](../../discussion/lessons/DSC-0058-program-registry-type-and-function-metadata/LSN-0059-registry-boundaries-and-owned-values.md) explains the published mechanisms. The [producer handoff](registry-producer-handoff.md) documents schema, input IDs and named-argument order, while [layout evidence](registry-layout-evidence.md) records reproducible load/access/GC measurements and the current publication boundary.
|
||||||
|
|
||||||
|
|||||||
@@ -119,22 +119,20 @@ fresh measurement.
|
|||||||
|
|
||||||
## Commands and CI
|
## Commands and CI
|
||||||
|
|
||||||
`make ci-domains` is the authoritative repository quality gate. Both
|
[Jenkins](../../files/config/Jenkinsfile) orchestrates the quality gate through explicit
|
||||||
[GitHub CI](../../.github/workflows/ci.yml) and
|
stages invoking Makefile targets. `make ci-domains` runs the same checks locally
|
||||||
[Jenkins](../../files/config/Jenkinsfile) provision dependencies and invoke that
|
and in [GitHub CI](../../.github/workflows/ci.yml); `make ci` is an alias.
|
||||||
same target. `make ci` is an alias. Invoke one gate per checkout at a time.
|
Invoke one gate per checkout at a time.
|
||||||
|
|
||||||
The Makefile supplies this ordered sequence to the serial evidence runner:
|
The ordered checks are:
|
||||||
|
|
||||||
1. Clean LLVM coverage instrumentation from the previous run.
|
1. Clean previous LLVM coverage instrumentation and reports.
|
||||||
2. Check formatting with `cargo fmt --all -- --check`.
|
2. Check formatting.
|
||||||
3. Run `cargo clippy --workspace --all-targets --all-features -- -D warnings`.
|
3. Run workspace Clippy with warnings denied.
|
||||||
4. Test gate failure/report handling with the Python regression suite.
|
4. Run workspace tests across all targets and features.
|
||||||
5. Run `cargo test --workspace --all-targets --all-features --no-fail-fast`.
|
5. Run the five ignored debugger socket tests.
|
||||||
6. Run the five ignored debugger socket tests through `make test-debugger-socket`.
|
6. Generate workspace coverage, HTML, full JSON, Cobertura and summary JSON.
|
||||||
7. Generate fresh workspace/all-feature LLVM coverage, HTML, full JSON,
|
7. Audit source ownership/evidence and check every fixed coverage domain floor.
|
||||||
Cobertura XML and summary JSON.
|
|
||||||
8. Audit source ownership/evidence and check every fixed coverage domain floor.
|
|
||||||
|
|
||||||
The socket command is deliberately restricted:
|
The socket command is deliberately restricted:
|
||||||
|
|
||||||
@@ -148,8 +146,8 @@ It selects `test_debug_port_opens`, `test_debug_reconnection`,
|
|||||||
Local sandbox TCP permissions must permit bind/connect; a permission denial is
|
Local sandbox TCP permissions must permit bind/connect; a permission denial is
|
||||||
not evidence of a debugger behavior regression.
|
not evidence of a debugger behavior regression.
|
||||||
|
|
||||||
The runner executes child Make targets with `-j1` even if the outer invocation
|
The local Make recipe executes child targets serially with `-j1`, even if the outer
|
||||||
uses `-j`. CI invokes `make ci-domains` serially. Do not run a separate Cargo,
|
invocation uses `-j`. Jenkins executes its stages sequentially. Do not run a separate Cargo,
|
||||||
coverage-clean or report process concurrently in the same checkout: serialized
|
coverage-clean or report process concurrently in the same checkout: serialized
|
||||||
steps inside one gate cannot protect against an independent process.
|
steps inside one gate cannot protect against an independent process.
|
||||||
|
|
||||||
@@ -169,26 +167,20 @@ runner still uses this helper after installing stable Rust.
|
|||||||
|
|
||||||
Linux packages include build-essential, pkg-config, libasound2-dev, libudev-dev,
|
Linux packages include build-essential, pkg-config, libasound2-dev, libudev-dev,
|
||||||
libxkbcommon-dev, libwayland-dev, libx11-dev, libxrandr-dev, libxi-dev, Python 3,
|
libxkbcommon-dev, libwayland-dev, libx11-dev, libxrandr-dev, libxi-dev, Python 3,
|
||||||
jq, ripgrep, Git, curl and CA certificates. ALSA development files satisfy CPAL's
|
jq, Git, curl and CA certificates. ALSA development files satisfy CPAL's
|
||||||
Linux build dependency; a running audio device is not needed. Non-Linux local
|
Linux build dependency; a running audio device is not needed. Non-Linux local
|
||||||
hosts must already provide native compiler/SDK tools, Bash, Make, pkg-config,
|
hosts must already provide native compiler/SDK tools, Bash, Make, pkg-config,
|
||||||
Python 3, jq, rg and Git. The provisioning script verifies these commands.
|
Python 3, jq and Git. The provisioning script verifies these commands.
|
||||||
|
|
||||||
`target/quality-gate/metadata.json` records revision, dirty working tree, host,
|
Jenkins owns stage status, console logs, build identity and artifact fingerprints.
|
||||||
Rust/coverage-tool versions, configuration/source fingerprints, ordered step
|
GitHub retains step logs and uploaded coverage artifacts. Local execution streams
|
||||||
exit codes and report hashes. Each step has a separate combined-output log.
|
command output and stops at the first failed target; no separate Python runner
|
||||||
The runner stops on the first failed Make target and returns its nonzero exit
|
or metadata report is required.
|
||||||
status; the log preserves underlying Cargo diagnostics. Three regression cases
|
|
||||||
check failure logs/identity, fresh success evidence and partial-report retention
|
|
||||||
when a later gate fails.
|
|
||||||
|
|
||||||
Both pipelines discard old generated report directories before environment checks or setup and
|
Both pipelines discard old coverage reports before prerequisite checks or setup,
|
||||||
publish current artifacts even after gate failure. An early failed gate has
|
and archive current `target/llvm-cov/**` reports even after failure. Early failures
|
||||||
metadata/logs but no old coverage report. Failure after generation preserves the
|
may leave no report; later failures retain partial current reports. Jenkins also
|
||||||
partial current reports. Prerequisite or setup failure can leave no report at all and
|
publishes HTML when present. Artifact publication does not mask a failed gate.
|
||||||
still fails CI. Reports are archived from `target/quality-gate/**` and
|
|
||||||
`target/llvm-cov/**`; Jenkins also publishes current HTML when present. Artifact
|
|
||||||
publication does not turn a failed gate into success.
|
|
||||||
|
|
||||||
List domains or inspect ownership and existing evidence:
|
List domains or inspect ownership and existing evidence:
|
||||||
|
|
||||||
@@ -218,7 +210,7 @@ cargo test -p prometeu-cli --test automation_process packaged_installation_smoke
|
|||||||
# File-host commit latency with the production asset decoder.
|
# File-host commit latency with the production asset decoder.
|
||||||
cargo test --release -p prometeu-system --all-features qualify_file_commits_with_production_asset_decoder -- --ignored --nocapture
|
cargo test --release -p prometeu-system --all-features qualify_file_commits_with_production_asset_decoder -- --ignored --nocapture
|
||||||
# Explicit layout observation.
|
# Explicit layout observation.
|
||||||
cargo test --release -p prometeu-bytecode --test registry_v1 reference_map_probe -- --ignored --exact --nocapture
|
cargo test --release -p prometeu-bytecode --test registry_v0 reference_map_probe -- --ignored --exact --nocapture
|
||||||
```
|
```
|
||||||
|
|
||||||
Other ignored timing probes remain opt-in by their individual test names.
|
Other ignored timing probes remain opt-in by their individual test names.
|
||||||
@@ -342,5 +334,5 @@ on that platform without lowering the existing floors.
|
|||||||
|
|
||||||
No physical audio, eight-hour soak, packaged-installation or ignored manual
|
No physical audio, eight-hour soak, packaged-installation or ignored manual
|
||||||
latency/layout qualification was selected by this gate. Prior manual observations
|
latency/layout qualification was selected by this gate. Prior manual observations
|
||||||
remain separate evidence. Current executable metadata and reports are emitted
|
remain separate evidence. Current coverage reports are emitted under `target/llvm-cov/`; CI retains execution
|
||||||
under `target/quality-gate/` and `target/llvm-cov/` by every invocation.
|
logs and build status.
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ For exact immediates and stack effects, see `CoreOpCode::spec()` which is the si
|
|||||||
|
|
||||||
## Registry instruction encodings
|
## Registry instruction encodings
|
||||||
|
|
||||||
The [Registry contract](../specs/runtime/02c-program-registry-and-pbx-v1.md#dynamic-and-reference-instructions)
|
The [Registry contract](../specs/runtime/02c-program-registry-and-pbx-v0.md#dynamic-and-reference-instructions)
|
||||||
defines opcodes 0x0090–0x0096. Tooling recognizes their u32 TypeId immediates:
|
defines opcodes 0x0090–0x0096. Tooling recognizes their u32 TypeId immediates:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ overshoot, and faults precede BudgetExhausted without successful-step credit.
|
|||||||
|
|
||||||
Generated metadata exposes guest mutation and variable costs. No RNG execution
|
Generated metadata exposes guest mutation and variable costs. No RNG execution
|
||||||
uses HostContext, syscalls, host entropy/time/address initialization, FFI,
|
uses HostContext, syscalls, host entropy/time/address initialization, FFI,
|
||||||
bigint runtime arithmetic or a parallel catalog. PBX v1 remains unchanged;
|
bigint runtime arithmetic or a parallel catalog. PBX v0 remains unchanged;
|
||||||
unreachable unknown IDs reject with InvalidCode/NativeId and Unknown analysis
|
unreachable unknown IDs reject with InvalidCode/NativeId and Unknown analysis
|
||||||
retains full runtime checks.
|
retains full runtime checks.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Typed collection producer and consumer handoff
|
# Typed collection producer and consumer handoff
|
||||||
|
|
||||||
The [collection ISA](../specs/runtime/02-vm-instruction-set.md#typed-collection-instructions), [memory contract](../specs/runtime/03-memory-stack-heap-and-allocation.md#typed-array-and-struct-storage) and [attempt charging](../specs/runtime/01-time-model-and-cycles.md#collection-attempt-charging) are normative. This interface has executable evidence through locally serialized PBX v1, `ValidatedProgramImage::load` and `VirtualMachine::from_image`. Production initialize, internal test producers and both example generators use the same sealed v1 path. External SDK/frontend adaptation remains a separate consumer obligation.
|
The [collection ISA](../specs/runtime/02-vm-instruction-set.md#typed-collection-instructions), [memory contract](../specs/runtime/03-memory-stack-heap-and-allocation.md#typed-array-and-struct-storage) and [attempt charging](../specs/runtime/01-time-model-and-cycles.md#collection-attempt-charging) are normative. This interface has executable evidence through locally serialized PBX v0, `ValidatedProgramImage::load` and `VirtualMachine::from_image`. Production initialize, internal test producers and both example generators use the same sealed v0 path. External SDK/frontend adaptation remains a separate consumer obligation.
|
||||||
|
|
||||||
## Encoding and complete groups
|
## Encoding and complete groups
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ Consumers must recognize all seven encodings, invoke Registry-derived effects in
|
|||||||
|
|
||||||
Executable oracles live in bytecode `tests/registry_isa.rs`, VM `tests/collection_conformance.rs`, VM `virtual_machine/collections_tests.rs` and layer `tests/typed_collections.rs`. They cover independent bytes, default/alias/group operations, attempt costs and refusals, malformed/proven types, ownership and actual FRAME_SYNC graph reclamation. VM unit tests inject otherwise unreachable invalid state only inside tests. Optimized ownership/conformance runs complement debug evidence.
|
Executable oracles live in bytecode `tests/registry_isa.rs`, VM `tests/collection_conformance.rs`, VM `virtual_machine/collections_tests.rs` and layer `tests/typed_collections.rs`. They cover independent bytes, default/alias/group operations, attempt costs and refusals, malformed/proven types, ownership and actual FRAME_SYNC graph reclamation. VM unit tests inject otherwise unreachable invalid state only inside tests. Optimized ownership/conformance runs complement debug evidence.
|
||||||
|
|
||||||
Dummy Boy and Stress emit sealed PBX v1, including empty captures sections, and
|
Dummy Boy and Stress emit sealed PBX v0, including empty captures sections, and
|
||||||
run through the production host. Fn is a one-slot nullable HeapRef value in fields
|
run through the production host. Fn is a one-slot nullable HeapRef value in fields
|
||||||
and arrays; Dynamic can carry it with its exact Fn TypeId. Closure environments and
|
and arrays; Dynamic can carry it with its exact Fn TypeId. Closure environments and
|
||||||
shared private cells participate in existing reference maps. Default construction
|
shared private cells participate in existing reference maps. Default construction
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ three PUSH_I64 at 2 each, three GET_LOCAL at 2 each, SET_LOCAL at 2 and RET at 4
|
|||||||
Its ordered results are Int64 bits 0x86B1DA1D72062B68, Float bits
|
Its ordered results are Int64 bits 0x86B1DA1D72062B68, Float bits
|
||||||
0x3FB304AA46C98538 and Int64 -7. The unit interval consumes the third word;
|
0x3FB304AA46C98538 and Int64 -7. The unit interval consumes the third word;
|
||||||
a subsequent next returns bits 0xF9090E529A7DAE00. Actual producer emission is
|
a subsequent next returns bits 0xF9090E529A7DAE00. Actual producer emission is
|
||||||
exercised by the VM random contract tests through the official PBX v1 writer
|
exercised by the VM random contract tests through the official PBX v0 writer
|
||||||
and loader, not direct host callbacks.
|
and loader, not direct host callbacks.
|
||||||
|
|
||||||
## Storage and Dynamic
|
## Storage and Dynamic
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# Registry layout, load and GC evidence
|
# Registry layout, load and GC evidence
|
||||||
|
|
||||||
This report records bounded technical fixtures for Registry layout, loading and GC. The normative contract is [Program Registry and PBX v1](../specs/runtime/02c-program-registry-and-pbx-v1.md); producer obligations and publication status are in the [producer handoff](registry-producer-handoff.md). [Registry Boundaries and Owned Values](../../discussion/lessons/DSC-0058-program-registry-type-and-function-metadata/LSN-0059-registry-boundaries-and-owned-values.md) explains the published mechanisms.
|
This report records bounded technical fixtures for Registry layout, loading and GC. The normative contract is [Program Registry and PBX v0](../specs/runtime/02c-program-registry-and-pbx-v0.md); producer obligations and publication status are in the [producer handoff](registry-producer-handoff.md). [Registry Boundaries and Owned Values](../../discussion/lessons/DSC-0058-program-registry-type-and-function-metadata/LSN-0059-registry-boundaries-and-owned-values.md) explains the published mechanisms.
|
||||||
|
|
||||||
Measured on 2026-10-07: Darwin arm64, Rust 1.98.1 (`48a229cea`), host `aarch64-apple-darwin`, LLVM 22.1.8, optimized Cargo release profile. The code baseline is `c6fff08`; this report's commit also contains the load high-water instrumentation and measurement fixtures. Wall-clock values are single observations, not thresholds or statistically established throughput. No timing assertion is used.
|
Measured on 2026-10-07: Darwin arm64, Rust 1.98.1 (`48a229cea`), host `aarch64-apple-darwin`, LLVM 22.1.8, optimized Cargo release profile. The code baseline is `c6fff08`; this report's commit also contains the load high-water instrumentation and measurement fixtures. Wall-clock values are single observations, not thresholds or statistically established throughput. No timing assertion is used.
|
||||||
|
|
||||||
## Reproduction
|
## Reproduction
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cargo test -p prometeu-bytecode --release --test registry_v1 reference_map_probe -- --ignored --nocapture
|
cargo test -p prometeu-bytecode --release --test registry_v0 reference_map_probe -- --ignored --nocapture
|
||||||
cargo test -p prometeu-vm --release --lib probe -- --ignored --nocapture --test-threads=1
|
cargo test -p prometeu-vm --release --lib probe -- --ignored --nocapture --test-threads=1
|
||||||
cargo test -p prometeu-vm --release --lib decoded_trait_box_is_the_only_receiver_root_across_frame_sync_gc --quiet
|
cargo test -p prometeu-vm --release --lib decoded_trait_box_is_the_only_receiver_root_across_frame_sync_gc --quiet
|
||||||
cargo test -p prometeu-vm --lib ownership_tests --quiet
|
cargo test -p prometeu-vm --lib ownership_tests --quiet
|
||||||
@@ -92,6 +92,6 @@ The native fixture stores one session-imported 13-byte String in both a String f
|
|||||||
|
|
||||||
## Publication boundary
|
## Publication boundary
|
||||||
|
|
||||||
The sealed v1 image, bounded verifier, typed direct calls, Dynamic/reference execution, metered native strings and structured host diagnostics have executable evidence. Production `VirtualMachine::initialize` still uses the old loader, and existing generators still emit version 0. Their coordinated migration must preserve existing closures and requires a typed callable contract; the producer handoff records pending implementation targets and validation requirements.
|
The sealed v0 image, bounded verifier, typed direct calls, Dynamic/reference execution, metered native strings and structured host diagnostics have executable evidence. Production `VirtualMachine::initialize` and both example generators now use the validated Registry format with typed callables and mandatory captures. The PBX version remains 0 during development; the producer handoff describes the current schema.
|
||||||
|
|
||||||
These measurements cover bounded layout/load/access/ownership/GC behavior. Representative-game capacity/headroom and coordinated long-run stress require separate workloads and evidence. No external compiler implementation, cross-host stress acceptance, regenerated production PBX smoke or final production activation is claimed by this report.
|
These measurements cover bounded layout/load/access/ownership/GC behavior. Representative-game capacity/headroom and coordinated long-run stress require separate workloads and evidence. No external compiler implementation, cross-host stress acceptance, regenerated production PBX smoke or final production activation is claimed by this report.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Registry v1 producer and consumer handoff
|
# Registry producer and consumer handoff
|
||||||
|
|
||||||
This document describes the Registry v1 producer and consumer interfaces. The normative contract
|
This document describes the Registry producer and consumer interfaces. The normative contract
|
||||||
is [Program Registry and PBX v1](../specs/runtime/02c-program-registry-and-pbx-v1.md).
|
is [Program Registry and PBX v0](../specs/runtime/02c-program-registry-and-pbx-v0.md).
|
||||||
The rationale and published mechanisms are explained in [Registry Boundaries and Owned Values](../../discussion/lessons/DSC-0058-program-registry-type-and-function-metadata/LSN-0059-registry-boundaries-and-owned-values.md).
|
The rationale and published mechanisms are explained in [Registry Boundaries and Owned Values](../../discussion/lessons/DSC-0058-program-registry-type-and-function-metadata/LSN-0059-registry-boundaries-and-owned-values.md).
|
||||||
The completed callable and production integration is explained in [Typed Callables and Frame-Owned Continuations](../../discussion/lessons/DSC-0052-vm-closures-captures-and-dynamic-calls/LSN-0061-typed-callables-and-frame-owned-continuations.md).
|
The completed callable and production integration is explained in [Typed Callables and Frame-Owned Continuations](../../discussion/lessons/DSC-0052-vm-closures-captures-and-dynamic-calls/LSN-0061-typed-callables-and-frame-owned-continuations.md).
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ The completed callable and production integration is explained in [Typed Callabl
|
|||||||
The production `initialize` path uses bounded `ValidatedProgramImage::load` and
|
The production `initialize` path uses bounded `ValidatedProgramImage::load` and
|
||||||
`VirtualMachine::from_image`. The v0 decoder, slot-only verifier, scheduler and
|
`VirtualMachine::from_image`. The v0 decoder, slot-only verifier, scheduler and
|
||||||
unchecked executable constructors have been removed. Internal test producers,
|
unchecked executable constructors have been removed. Internal test producers,
|
||||||
Dummy Boy and Stress emit sealed v1 with typed Fn metadata and mandatory captures.
|
Dummy Boy and Stress emit sealed v0 with typed Fn metadata and mandatory captures.
|
||||||
The runtime retains existing constant/string ownership, collections, Dynamic and
|
The runtime retains existing constant/string ownership, collections, Dynamic and
|
||||||
reference boundaries. The separate render frame scheduler remains active.
|
reference boundaries. The separate render frame scheduler remains active.
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ repository publishes requirements and oracles; those modules have not been edite
|
|||||||
|
|
||||||
## Exact producer obligations
|
## Exact producer obligations
|
||||||
|
|
||||||
Emit PBX version 1 only. The header is 32 bytes: magic at 0, u16 version at 4,
|
Emit PBX version 0 only. The header is 32 bytes: magic at 0, u16 version at 4,
|
||||||
little-endian flag 0 at 6, reserved zero at 7, section count at 8 and twenty zero
|
little-endian flag 0 at 6, reserved zero at 7, section count at 8 and twenty zero
|
||||||
bytes at 12. Directory entries are file-relative u32 kind/offset/length triples.
|
bytes at 12. Directory entries are file-relative u32 kind/offset/length triples.
|
||||||
Mandatory kinds are 0, 1, 2, 4, 5, 6, 7 and 8; debug kind 3 is optional. Keep empty
|
Mandatory kinds are 0, 1, 2, 4, 5, 6, 7 and 8; debug kind 3 is optional. Keep empty
|
||||||
@@ -85,7 +85,7 @@ and payload publication cannot deadlock each other.
|
|||||||
## Independent binary oracles
|
## Independent binary oracles
|
||||||
|
|
||||||
The manually specified minimal executable in
|
The manually specified minimal executable in
|
||||||
`crates/console/prometeu-bytecode/tests/registry_v1.rs::minimal_bytes` is 194 bytes.
|
`crates/console/prometeu-bytecode/tests/registry_v0.rs::minimal_bytes` is 194 bytes.
|
||||||
Its directory begins at 32; eight entries end at 128:
|
Its directory begins at 32; eight entries end at 128:
|
||||||
|
|
||||||
| Kind | Offset | Length | Payload |
|
| Kind | Offset | Length | Payload |
|
||||||
@@ -125,7 +125,7 @@ execution remains valid. Names do not adapt trait method compatibility.
|
|||||||
|
|
||||||
## Endpoint-free input lowering
|
## Endpoint-free input lowering
|
||||||
|
|
||||||
The [complete 54-entry table](../specs/runtime/02c-program-registry-and-pbx-v1.md#input)
|
The [complete 54-entry table](../specs/runtime/02c-program-registry-and-pbx-v0.md#input)
|
||||||
defines every accepted name/ID/result. Queries take zero guest arguments, read the
|
defines every accepted name/ID/result. Queries take zero guest arguments, read the
|
||||||
logical-frame snapshot and cost one intrinsic cycle. States return Bool;
|
logical-frame snapshot and cost one intrinsic cycle. States return Bool;
|
||||||
hold/x/y return Int64. For example, `input.pad.a.down` lowers directly to
|
hold/x/y return Int64. For example, `input.pad.a.down` lowers directly to
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ elapsed; the user explicitly waived the eight-hour completion requirement for
|
|||||||
this delivery. Eight-hour endurance was not demonstrated. Linux and other
|
this delivery. Eight-hour endurance was not demonstrated. Linux and other
|
||||||
architectures have not been tested by this qualification.
|
architectures have not been tested by this qualification.
|
||||||
|
|
||||||
The normative contracts remain [Registry/PBX v1](../specs/runtime/02c-program-registry-and-pbx-v1.md),
|
The normative contracts remain [Registry/PBX v0](../specs/runtime/02c-program-registry-and-pbx-v0.md),
|
||||||
[memory/GC](../specs/runtime/03-memory-stack-heap-and-allocation.md),
|
[memory/GC](../specs/runtime/03-memory-stack-heap-and-allocation.md),
|
||||||
[typed callables](../specs/runtime/02b-vm-function-values-and-closures.md), and
|
[typed callables](../specs/runtime/02b-vm-function-values-and-closures.md), and
|
||||||
[single-context lifecycle](../specs/runtime/09a-coroutines-and-cooperative-scheduling.md).
|
[single-context lifecycle](../specs/runtime/09a-coroutines-and-cooperative-scheduling.md).
|
||||||
@@ -56,9 +56,9 @@ and function context are checked where applicable. VM quotas are not RSS caps.
|
|||||||
| Resource / invariant | Accepted limit / rule | Enforcement and evidence |
|
| Resource / invariant | Accepted limit / rule | Enforcement and evidence |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| Input PBX | 64 MiB | HAL `cartridge_loader::read_program` checks metadata before read and detects extra data without unchecked growth. `program_admission_accepts_exact_limit_and_rejects_growth_after_metadata`, metadata-before-read, short/interrupted-read and real sparse-file rejection tests. |
|
| Input PBX | 64 MiB | HAL `cartridge_loader::read_program` checks metadata before read and detects extra data without unchecked growth. `program_admission_accepts_exact_limit_and_rejects_growth_after_metadata`, metadata-before-read, short/interrupted-read and real sparse-file rejection tests. |
|
||||||
| Code | 32 MiB | Bytecode envelope/owned decoder uses `LoadBudget` before materialization; `registry_v1` covers oversized declarations, truncation, code ranges and transactional payload refusal. |
|
| Code | 32 MiB | Bytecode envelope/owned decoder uses `LoadBudget` before materialization; `registry_v0` covers oversized declarations, truncation, code ranges and transactional payload refusal. |
|
||||||
| Type/function records | 65,536 each | Registry decoder/resolver bounded count admission; `oversized_counts_fail_before_dependent_allocation` and invalid reference tests. |
|
| Type/function records | 65,536 each | Registry decoder/resolver bounded count admission; `oversized_counts_fail_before_dependent_allocation` and invalid reference tests. |
|
||||||
| Implementation/nested records | 262,144 / 1,048,576 | Registry resolution/codec count checks; multi-slot/trait records, aggregate checks and owned-payload rollback coverage in `registry_v1`. |
|
| Implementation/nested records | 262,144 / 1,048,576 | Registry resolution/codec count checks; multi-slot/trait records, aggregate checks and owned-payload rollback coverage in `registry_v0`. |
|
||||||
| Names | 4,096 bytes each; 4 MiB aggregate | `name_limits_include_aggregate_and_empty_is_not_absent`; invalid UTF-8/flags/tails rejected before publication. |
|
| Names | 4,096 bytes each; 4 MiB aggregate | `name_limits_include_aggregate_and_empty_is_not_absent`; invalid UTF-8/flags/tails rejected before publication. |
|
||||||
| Retained Registry | 64 MiB/image | Charged native layouts/capacities during resolution; `work_retained_and_temporary_limits_refuse_before_publication`; explicit reference-map probe records native representation. |
|
| Retained Registry | 64 MiB/image | Charged native layouts/capacities during resolution; `work_retained_and_temporary_limits_refuse_before_publication`; explicit reference-map probe records native representation. |
|
||||||
| Load scratch | 128 MiB | Parser/writer/verifier temporary buffers charged and refunded; `scratch_is_refunded_per_function_and_preserves_prior_load_ownership`, `stack_analysis_refunds_all_state_buffers_and_preserves_prior_ownership`, sealed-image load probe. |
|
| Load scratch | 128 MiB | Parser/writer/verifier temporary buffers charged and refunded; `scratch_is_refunded_per_function_and_preserves_prior_load_ownership`, `stack_analysis_refunds_all_state_buffers_and_preserves_prior_ownership`, sealed-image load probe. |
|
||||||
@@ -79,7 +79,7 @@ and function context are checked where applicable. VM quotas are not RSS caps.
|
|||||||
| No-sync loop | Existing slice/fuel semantics | 1,000 finite slices of a sealed `JMP 0` program return BudgetExhausted, preserve PC/depth/capacities, perform no GC, and remain breakpoint-controllable. No frame completion is fabricated. |
|
| No-sync loop | Existing slice/fuel semantics | 1,000 finite slices of a sealed `JMP 0` program return BudgetExhausted, preserve PC/depth/capacities, perform no GC, and remain breakpoint-controllable. No frame completion is fabricated. |
|
||||||
|
|
||||||
Relevant test sources:
|
Relevant test sources:
|
||||||
[Registry v1](../../crates/console/prometeu-bytecode/tests/registry_v1.rs),
|
[Registry](../../crates/console/prometeu-bytecode/tests/registry_v0.rs),
|
||||||
[HAL cartridge admission](../../crates/console/prometeu-hal/src/cartridge_loader.rs),
|
[HAL cartridge admission](../../crates/console/prometeu-hal/src/cartridge_loader.rs),
|
||||||
[heap](../../crates/console/prometeu-vm/src/heap.rs),
|
[heap](../../crates/console/prometeu-vm/src/heap.rs),
|
||||||
[string ledger](../../crates/console/prometeu-vm/src/string_ledger/tests.rs),
|
[string ledger](../../crates/console/prometeu-vm/src/string_ledger/tests.rs),
|
||||||
|
|||||||
@@ -123,4 +123,4 @@ layout.
|
|||||||
These synthetic boundary measurements establish lookup work and ownership
|
These synthetic boundary measurements establish lookup work and ownership
|
||||||
behavior. They do not establish gameplay/frame speedups, long-run memory stability,
|
behavior. They do not establish gameplay/frame speedups, long-run memory stability,
|
||||||
other-platform timings or hardware-independent latency limits. The normative
|
other-platform timings or hardware-independent latency limits. The normative
|
||||||
ownership contract is in [Registry and PBX](../specs/runtime/02c-program-registry-and-pbx-v1.md#memory-ownership-and-quotas).
|
ownership contract is in [Registry and PBX](../specs/runtime/02c-program-registry-and-pbx-v0.md#memory-ownership-and-quotas).
|
||||||
|
|||||||
Vendored
+34
-10
@@ -5,12 +5,12 @@ pipeline {
|
|||||||
CARGO_HOME = '/var/jenkins_home/.cargo'
|
CARGO_HOME = '/var/jenkins_home/.cargo'
|
||||||
CARGO_TARGET_DIR = 'target'
|
CARGO_TARGET_DIR = 'target'
|
||||||
CARGO_TERM_COLOR = 'always'
|
CARGO_TERM_COLOR = 'always'
|
||||||
|
PATH = "${CARGO_HOME}/bin:${env.PATH}"
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Prepare reports') {
|
stage('Prepare reports') {
|
||||||
steps {
|
steps {
|
||||||
dir('target/quality-gate') { deleteDir() }
|
|
||||||
dir('target/llvm-cov') { deleteDir() }
|
dir('target/llvm-cov') { deleteDir() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,20 +23,44 @@ pipeline {
|
|||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Quality gate') {
|
stage('Clean coverage') {
|
||||||
steps {
|
steps { sh 'make -j1 clean' }
|
||||||
sh '''
|
}
|
||||||
set -eu
|
stage('Formatting') {
|
||||||
export PATH="$CARGO_HOME/bin:$PATH"
|
steps { sh 'make -j1 fmt-check' }
|
||||||
make ci-domains
|
}
|
||||||
'''
|
stage('Clippy') {
|
||||||
}
|
steps { sh 'make -j1 clippy' }
|
||||||
|
}
|
||||||
|
stage('Workspace tests') {
|
||||||
|
steps { sh 'make -j1 test-local' }
|
||||||
|
}
|
||||||
|
stage('Debugger socket tests') {
|
||||||
|
steps { sh 'make -j1 test-debugger-socket' }
|
||||||
|
}
|
||||||
|
stage('Coverage') {
|
||||||
|
steps { sh 'make -j1 coverage' }
|
||||||
|
}
|
||||||
|
stage('Coverage JSON') {
|
||||||
|
steps { sh 'make -j1 coverage-report-json' }
|
||||||
|
}
|
||||||
|
stage('Cobertura') {
|
||||||
|
steps { sh 'make -j1 coverage-xml' }
|
||||||
|
}
|
||||||
|
stage('Coverage summary') {
|
||||||
|
steps { sh 'make -j1 coverage-json' }
|
||||||
|
}
|
||||||
|
stage('Coverage ownership audit') {
|
||||||
|
steps { sh 'make -j1 coverage-domain-audit' }
|
||||||
|
}
|
||||||
|
stage('Coverage domain floors') {
|
||||||
|
steps { sh 'make -j1 coverage-domain-gate' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
archiveArtifacts artifacts: 'target/quality-gate/**,target/llvm-cov/**',
|
archiveArtifacts artifacts: 'target/llvm-cov/**',
|
||||||
fingerprint: true, allowEmptyArchive: true
|
fingerprint: true, allowEmptyArchive: true
|
||||||
publishHTML(target: [
|
publishHTML(target: [
|
||||||
allowMissing: true,
|
allowMissing: true,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ fail() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
for command in rustup cargo rustc python3 jq rg git make pkg-config; do
|
for command in rustup cargo rustc python3 jq git make pkg-config; do
|
||||||
command -v "$command" >/dev/null || fail "$command"
|
command -v "$command" >/dev/null || fail "$command"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -150,10 +150,10 @@ if [[ ${SHOW_PATHS} -eq 1 ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${SHOW_TRACKED_FILES} -eq 1 ]]; then
|
if [[ ${SHOW_TRACKED_FILES} -eq 1 ]]; then
|
||||||
echo "Tracked files present in repository:"
|
echo "Repository files (including untracked, excluding ignored):"
|
||||||
(
|
(
|
||||||
cd "${ROOT}"
|
cd "${ROOT}"
|
||||||
rg --files crates
|
git ls-files --cached --others --exclude-standard -- crates
|
||||||
) | jq -Rr --arg domain "${DOMAIN}" --slurpfile config "${CONFIG_PATH}" '
|
) | jq -Rr --arg domain "${DOMAIN}" --slurpfile config "${CONFIG_PATH}" '
|
||||||
$config[0].domains[$domain] as $mapping
|
$config[0].domains[$domain] as $mapping
|
||||||
| . as $name
|
| . as $name
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ if [[ "$(uname -s)" == Linux ]]; then
|
|||||||
"${admin[@]}" apt-get install -y --no-install-recommends \
|
"${admin[@]}" apt-get install -y --no-install-recommends \
|
||||||
build-essential pkg-config libasound2-dev libudev-dev libxkbcommon-dev \
|
build-essential pkg-config libasound2-dev libudev-dev libxkbcommon-dev \
|
||||||
libwayland-dev libx11-dev libxrandr-dev libxi-dev \
|
libwayland-dev libx11-dev libxrandr-dev libxi-dev \
|
||||||
python3 jq ripgrep git curl ca-certificates
|
python3 jq git curl ca-certificates
|
||||||
fi
|
fi
|
||||||
for command in rustup cargo python3 jq rg git make pkg-config; do
|
for command in rustup cargo python3 jq git make pkg-config; do
|
||||||
command -v "$command" >/dev/null || { echo "Missing quality-gate prerequisite: $command" >&2; exit 1; }
|
command -v "$command" >/dev/null || { echo "Missing quality-gate prerequisite: $command" >&2; exit 1; }
|
||||||
done
|
done
|
||||||
rustup component add rustfmt clippy llvm-tools-preview
|
rustup component add rustfmt clippy llvm-tools-preview
|
||||||
|
|||||||
@@ -1,101 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
"""Run Makefile-owned gate steps serially and retain evidence on failure."""
|
|
||||||
import hashlib
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
from pathlib import Path
|
|
||||||
import platform
|
|
||||||
import shutil
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
from datetime import datetime, timezone
|
|
||||||
|
|
||||||
|
|
||||||
def capture(*command):
|
|
||||||
try:
|
|
||||||
result = subprocess.run(command, text=True, stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT, check=False)
|
|
||||||
return {"exit_code": result.returncode, "output": result.stdout.strip()}
|
|
||||||
except OSError as error:
|
|
||||||
return {"exit_code": 127, "output": str(error)}
|
|
||||||
|
|
||||||
|
|
||||||
def sha(path):
|
|
||||||
return hashlib.sha256(path.read_bytes()).hexdigest()
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
root = Path(__file__).resolve().parent.parent
|
|
||||||
os.chdir(root)
|
|
||||||
output = root / "target/quality-gate"
|
|
||||||
# These two directories contain generated reports only. Never archive a
|
|
||||||
# previous run's coverage as evidence for an early lint/test failure.
|
|
||||||
for directory in (output, root / "target/llvm-cov"):
|
|
||||||
if directory.exists():
|
|
||||||
shutil.rmtree(directory)
|
|
||||||
output.mkdir(parents=True)
|
|
||||||
inputs = [Path("Makefile"), Path("Cargo.lock"), Path(".github/workflows/ci.yml"),
|
|
||||||
Path("files/config/Jenkinsfile"), Path("files/config/runtime-edge-coverage-domains.json")]
|
|
||||||
inputs.extend(sorted(Path("scripts").rglob("*.py")))
|
|
||||||
inputs.extend(sorted(Path("scripts").glob("*.sh")))
|
|
||||||
fingerprints = {str(path): sha(path) for path in inputs if path.is_file()}
|
|
||||||
sources = "".join(f"{path}\0{sha(path)}\n" for path in sorted(Path("crates").rglob("*.rs")))
|
|
||||||
evidence = {
|
|
||||||
"started_utc": datetime.now(timezone.utc).isoformat(),
|
|
||||||
"host": platform.platform(), "revision": capture("git", "rev-parse", "HEAD"),
|
|
||||||
"working_tree": capture("git", "status", "--porcelain"),
|
|
||||||
"rustc": capture("rustc", "-vV"), "cargo_llvm_cov": capture("cargo", "llvm-cov", "--version"),
|
|
||||||
"config_sha256": fingerprints,
|
|
||||||
"rust_source_sha256": hashlib.sha256(sources.encode()).hexdigest(),
|
|
||||||
"source_hash_algorithm": "SHA-256 of sorted path + NUL + file SHA-256 hex + newline records",
|
|
||||||
"steps": [], "status": "running",
|
|
||||||
}
|
|
||||||
metadata = output / "metadata.json"
|
|
||||||
|
|
||||||
def persist():
|
|
||||||
metadata.write_text(json.dumps(evidence, indent=2) + "\n")
|
|
||||||
|
|
||||||
persist()
|
|
||||||
exit_code = 0
|
|
||||||
try:
|
|
||||||
if not sys.argv[1:]:
|
|
||||||
raise ValueError("Makefile must supply the required gate steps")
|
|
||||||
for target in sys.argv[1:]:
|
|
||||||
if not target.replace("-", "").isalnum():
|
|
||||||
raise ValueError(f"invalid make target: {target!r}")
|
|
||||||
command = ["make", "--no-print-directory", "-j1", target]
|
|
||||||
log = output / f"{target}.log"
|
|
||||||
print(f"Quality gate: {target}", flush=True)
|
|
||||||
with log.open("w") as stream:
|
|
||||||
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
|
|
||||||
text=True, errors="replace")
|
|
||||||
for line in process.stdout:
|
|
||||||
stream.write(line)
|
|
||||||
print(line, end="", flush=True)
|
|
||||||
result = process.wait()
|
|
||||||
exit_code = result if result >= 0 else 128 - result
|
|
||||||
evidence["steps"].append({"target": target, "command": command,
|
|
||||||
"exit_code": exit_code, "log_sha256": sha(log)})
|
|
||||||
persist()
|
|
||||||
if exit_code:
|
|
||||||
break
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
evidence["error"] = "Interrupted"
|
|
||||||
exit_code = 130
|
|
||||||
except Exception as error:
|
|
||||||
evidence["error"] = str(error)
|
|
||||||
exit_code = 1
|
|
||||||
finally:
|
|
||||||
evidence["status"] = "passed" if exit_code == 0 else "failed"
|
|
||||||
evidence["exit_code"] = exit_code
|
|
||||||
evidence["finished_utc"] = datetime.now(timezone.utc).isoformat()
|
|
||||||
evidence["reports_sha256"] = {
|
|
||||||
str(path.relative_to(root)): sha(path)
|
|
||||||
for path in sorted((root / "target/llvm-cov").rglob("*")) if path.is_file()
|
|
||||||
}
|
|
||||||
persist()
|
|
||||||
return exit_code
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
sys.exit(main())
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
"""Exercise real make failures without running Cargo or modifying the repository."""
|
|
||||||
import json
|
|
||||||
from pathlib import Path
|
|
||||||
import shutil
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
import tempfile
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
|
|
||||||
class QualityGateTests(unittest.TestCase):
|
|
||||||
def run_gate(self, makefile, targets):
|
|
||||||
temporary = tempfile.TemporaryDirectory()
|
|
||||||
self.addCleanup(temporary.cleanup)
|
|
||||||
root = Path(temporary.name)
|
|
||||||
(root / "scripts").mkdir()
|
|
||||||
shutil.copy(Path(__file__).resolve().parents[1] / "run-quality-gate.py", root / "scripts")
|
|
||||||
(root / "Makefile").write_text(makefile)
|
|
||||||
(root / "target/llvm-cov").mkdir(parents=True)
|
|
||||||
(root / "target/llvm-cov/stale.json").write_text("old evidence")
|
|
||||||
result = subprocess.run([sys.executable, str(root / "scripts/run-quality-gate.py"), *targets],
|
|
||||||
capture_output=True, text=True)
|
|
||||||
evidence = json.loads((root / "target/quality-gate/metadata.json").read_text())
|
|
||||||
self.assertFalse((root / "target/llvm-cov/stale.json").exists())
|
|
||||||
return root, result, evidence
|
|
||||||
|
|
||||||
def test_failure_preserves_logs_identity_exit_and_stops_later_steps(self):
|
|
||||||
root, result, evidence = self.run_gate(
|
|
||||||
'fail:\n\t@echo diagnostic\n\t@exit 7\nlater:\n\t@touch should-not-exist\n',
|
|
||||||
['fail', 'later'])
|
|
||||||
self.assertNotEqual(result.returncode, 0)
|
|
||||||
self.assertEqual(evidence['exit_code'], result.returncode)
|
|
||||||
self.assertEqual(evidence['status'], 'failed')
|
|
||||||
self.assertEqual([step['target'] for step in evidence['steps']], ['fail'])
|
|
||||||
self.assertIn('diagnostic', (root / 'target/quality-gate/fail.log').read_text())
|
|
||||||
self.assertIn('Makefile', evidence['config_sha256'])
|
|
||||||
self.assertIn('revision', evidence)
|
|
||||||
self.assertEqual(evidence['reports_sha256'], {})
|
|
||||||
self.assertFalse((root / 'should-not-exist').exists())
|
|
||||||
|
|
||||||
def test_success_fingerprints_only_current_reports(self):
|
|
||||||
_, result, evidence = self.run_gate(
|
|
||||||
'report:\n\t@mkdir -p target/llvm-cov\n\t@echo fresh > target/llvm-cov/report.json\n',
|
|
||||||
['report'])
|
|
||||||
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
|
||||||
self.assertEqual(evidence['status'], 'passed')
|
|
||||||
self.assertEqual(list(evidence['reports_sha256']), ['target/llvm-cov/report.json'])
|
|
||||||
|
|
||||||
def test_partial_report_is_retained_when_a_later_gate_fails(self):
|
|
||||||
_, result, evidence = self.run_gate(
|
|
||||||
'report:\n\t@mkdir -p target/llvm-cov\n\t@echo fresh > target/llvm-cov/report.json\nfail:\n\t@exit 1\n',
|
|
||||||
['report', 'fail'])
|
|
||||||
self.assertNotEqual(result.returncode, 0)
|
|
||||||
self.assertEqual(evidence['status'], 'failed')
|
|
||||||
self.assertIn('target/llvm-cov/report.json', evidence['reports_sha256'])
|
|
||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user