Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/website/public/agents/spec-agents.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/website/public/crons/spec-crons.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/website/public/docs/system-docs.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/website/public/functions/spec-functions.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/website/public/skills/skills-core.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":1,"provenance":{"manifestSha256":"cd5b4b346ddd51c1cc4f9ea81dd96a3ba3d452ad7adb33f06066b161064bbfae","specManifestSha256":"14951edb8e3b9938389547ce6680d739e74a6787aed46a360bf37e2caf584b62","indexerSha256":"e7ad55414d2d48fa05cc7e2619af06bc4d3c82d6018c8a373adf3dc7402faff3"},"skillCount":27,"coverage":{"skillsBound":["t27/tri","t27/tri-pipeline","t27/wrap-up"],"skillsUnbound":["t27/measure-corpus","t27/phi-loop","t27/wave-audit","trinity/blog-post","trinity/board-sync","trinity/cloud","trinity/connect-accounts","trinity/doctor","trinity/farm-garden","trinity/fpga-synth","trinity/god-mode","trinity/implement-issue","trinity/queen-hive-visuals","trinity/review-code","trinity/run-tests","trinity/scholar","trinity/status","trinity/tech-tree","trinity/tri","trinity/trinity-test","trinity/ux-wave","trinity/vibee-gen","trinity/vsa-verify","trinity/wave"],"skillsBroken":[],"specsWithSkill":["compiler/skill/registry.t27","specs/automation/wrapup-auto.t27","specs/pipeline/e2e_test.t27"],"specsWithoutSkill":1574,"baselineUnbound":24},"skillToSpecs":{"t27/tri":["compiler/skill/registry.t27"],"t27/tri-pipeline":["specs/pipeline/e2e_test.t27"],"t27/wrap-up":["specs/automation/wrapup-auto.t27"]},"specToSkills":{"compiler/skill/registry.t27":["t27/tri"],"specs/automation/wrapup-auto.t27":["t27/wrap-up"],"specs/pipeline/e2e_test.t27":["t27/tri-pipeline"]}}
{"version":1,"provenance":{"manifestSha256":"cd5b4b346ddd51c1cc4f9ea81dd96a3ba3d452ad7adb33f06066b161064bbfae","specManifestSha256":"bad7f5df3cc13af42eb7edd3607caf328a9fb0cc0ba30f52369ef74d828858eb","indexerSha256":"e7ad55414d2d48fa05cc7e2619af06bc4d3c82d6018c8a373adf3dc7402faff3"},"skillCount":27,"coverage":{"skillsBound":["t27/tri","t27/tri-pipeline","t27/wrap-up"],"skillsUnbound":["t27/measure-corpus","t27/phi-loop","t27/wave-audit","trinity/blog-post","trinity/board-sync","trinity/cloud","trinity/connect-accounts","trinity/doctor","trinity/farm-garden","trinity/fpga-synth","trinity/god-mode","trinity/implement-issue","trinity/queen-hive-visuals","trinity/review-code","trinity/run-tests","trinity/scholar","trinity/status","trinity/tech-tree","trinity/tri","trinity/trinity-test","trinity/ux-wave","trinity/vibee-gen","trinity/vsa-verify","trinity/wave"],"skillsBroken":[],"specsWithSkill":["compiler/skill/registry.t27","specs/automation/wrapup-auto.t27","specs/pipeline/e2e_test.t27"],"specsWithoutSkill":1734,"baselineUnbound":24},"skillToSpecs":{"t27/tri":["compiler/skill/registry.t27"],"t27/tri-pipeline":["specs/pipeline/e2e_test.t27"],"t27/wrap-up":["specs/automation/wrapup-auto.t27"]},"specToSkills":{"compiler/skill/registry.t27":["t27/tri"],"specs/automation/wrapup-auto.t27":["t27/wrap-up"],"specs/pipeline/e2e_test.t27":["t27/tri-pipeline"]}}
2 changes: 1 addition & 1 deletion apps/website/public/skills/spec-skills.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// specs/formats/hf_bitnet.t27 -- Hugging Face transformers BitNet packed weights
// Restates upstream huggingface/transformers@2c4914fb939fe9de0d8e7a798af4684d552f18b4
// Restates upstream huggingface/transformers@07338b6c74a578868368e6e549dea83414e4b8cb
// src/transformers/integrations/bitnet.py: :14 (VALUES_PER_ITEM 4), :17-53
// (pack_weights: T + 1 shifted by 2i into row r of a [ceil(rows/4), cols]
// uint8 tensor), :56-121 (unpack_weights: slot i of packed row r is row
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// specs/formats/llama_cpp.t27 -- llama.cpp ternary block formats and GGUF tensor rules
// Restates upstream ggml-org/llama.cpp@e6ab7c1a41054a888ada952eab4c886444c2f5ad:
// Restates upstream ggml-org/llama.cpp@4364bf7232e65c34eca8d9500c5464389662de6b:
// ggml/include/ggml.h:424-433 (type ids TQ1_0 34, TQ2_0 35, Q1_0 41, Q2_0 42,
// GGML_TYPE_COUNT 43); ggml/src/ggml-common.h:180-185 (block_q1_0),
// :187-192 (block_q2_0), :275-281 (block_tq1_0), :283-288 (block_tq2_0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: Apache-2.0
// specs/formats/mlx.t27 -- MLX 2-bit affine quantization (codes, scales, biases)
// Restates upstream ml-explore/mlx@59d600b5e64c238427d0f8d897ab7c682ef4d3d2
// mlx/ops.cpp: :4957-5002 (pack_and_quantize: q = clip(round((w - bias) /
// Restates upstream ml-explore/mlx@0a8e18e034d61b591f53a0616c722d2d9770f379
// mlx/ops.cpp: :4974-5019 (pack_and_quantize: q = clip(round((w - bias) /
// scale), 0, 2^bits - 1), packed into uint32 words with shifts 2^(0, bits,
// 2 bits, ...), :4975), :5005-5020 (affine_quantize: group 32, 64 or 128;
// bits 2 to 8 except 7), :5059 (packed width cols * bits / 32), :5207
// (cols divisible by the group), :5223-5298 (affine_dequantize: code k of a
// word at bits k*bits, w = q * scale + bias per group, :5297-5298).
// 2 bits, ...), :4992), :5022-5037 (affine_quantize: group 32, 64 or 128;
// bits 2 to 8 except 7), :5076 (packed width cols * bits / 32), :5224
// (cols divisible by the group), :5240-5315 (affine_dequantize: code k of a
// word at bits k*bits, w = q * scale + bias per group, :5314-5315).
// For bits = 2 a row of cols weights is cols/16 uint32 words; stored
// little-endian, weight k of a row is in byte k/4 at bits 2(k%4). scales and
// biases have shape [rows, cols/group] in the model dtype (F16 in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// specs/formats/onnx.t27 -- ONNX Runtime com.microsoft.MatMulNBits with bits = 2
// Restates upstream microsoft/onnxruntime@2ecddca37183e39694d02f2dae222bed9931c9af:
// Restates upstream microsoft/onnxruntime@2b758bc652dc122fbbbc033664ffca69991a7e63:
// docs/ContribOperators.md:3756-3830 (MatMulNBits: :3762 dequantized_weight =
// (quantized_weight - zero_point) * scale; :3767 block_size a power of two,
// at least 16; :3787 bits 2, 4 or 8; :3800 B uint8 (N, k_blocks, blob_size),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// specs/formats/prismml.t27 -- PrismML llama.cpp fork: PQ2_0, PTQ1_0 and its group-64 Q2_0
// Restates upstream PrismML-Eng/llama.cpp@bdc23b56b4458b9f1655aec5287f3ab56ee8daaa
// Restates upstream PrismML-Eng/llama.cpp@87268f775d74cf8f7ffc6c22a95684aa55995533
// (branch prism): ggml/include/ggml.h:431-437 (Q1_0 41, Q2_0 42, PQ2_0 142,
// PTQ1_0 143, GGML_TYPE_COUNT 144); ggml/src/ggml-common.h:192-197 (block_q2_0,
// still group 64), :199-207 (block_pq2_0: one fp16 scale per 128 weights),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,22 @@ module TrinityMemoryBridgeSpec {
pub const TMS_BRIDGE_IDENTITY_BYTES: u32 = 16;
pub const TMS_BRIDGE_IDENTITY_ANCHOR: u32 = 18368;

// 10. Device backend (issue #64; a fork-local extension, not in the upstream
// emulator-only v1 copy). The emulator stays the default and every
// emulator response is unchanged. Backend fpga reports the device
// transport and the evidence block of the captures the build ran with:
// bitstream sha256, capture sha256, IDCODE and DNA. A server constructed
// with backend fpga but without the whole evidence block is rejected at
// construction, and its device methods answer with the transport error
// until a device is linked behind them.
pub const TMS_BRIDGE_TRANSPORT_IN_PROCESS: u32 = 0;
pub const TMS_BRIDGE_TRANSPORT_UART: u32 = 1;
pub const TMS_BRIDGE_EVIDENCE_BITSTREAM: u32 = 1;
pub const TMS_BRIDGE_EVIDENCE_CAPTURE: u32 = 2;
pub const TMS_BRIDGE_EVIDENCE_IDCODE: u32 = 4;
pub const TMS_BRIDGE_EVIDENCE_DNA: u32 = 8;
pub const TMS_BRIDGE_EVIDENCE_REQUIRED: u32 = 15;

// Reference functions.
pub fn tms_bridge_request_status(size: u64, max_request: u64, json_valid: bool) -> i32 {
if (size > max_request) { return TMS_HTTP_PAYLOAD_TOO_LARGE; }
Expand Down Expand Up @@ -260,6 +276,33 @@ module TrinityMemoryBridgeSpec {
+ max_trits * TMS_BRIDGE_RESPONSE_BYTES_PER_TRIT;
}

pub fn tms_bridge_backend_valid(backend: u32) -> bool {
return backend == 0 || backend == 1;
}

pub fn tms_bridge_backend_is_hardware(backend: u32) -> bool {
return backend == 1;
}

// The emulator computes in process; the device backend reaches the board over
// the loader's UART line.
pub fn tms_bridge_transport_valid(backend: u32, transport: u32) -> bool {
if (backend == 0) { return transport == TMS_BRIDGE_TRANSPORT_IN_PROCESS; }
return transport == TMS_BRIDGE_TRANSPORT_UART;
}

// The emulator carries no evidence; the device backend requires all four fields.
pub fn tms_bridge_evidence_valid(backend: u32, present: u32) -> bool {
if (backend == 0) { return present == 0; }
return present == TMS_BRIDGE_EVIDENCE_REQUIRED;
}

// A device identity needs a nonzero IDCODE read from the board (0x3636093 on
// the AX7203, XC7A200T); DNA covers the rest of the receipt.
pub fn tms_bridge_idcode_valid(idcode: u32) -> bool {
return idcode != 0;
}

// Invariants: constant expressions, compiled as static assertions.
invariant error_codes_are_distinct_and_negative {
assert TMS_RPC_ERR_PARSE < TMS_RPC_ERR_INTERNAL && TMS_RPC_ERR_INTERNAL < TMS_RPC_ERR_INVALID_PARAMS
Expand Down Expand Up @@ -313,6 +356,10 @@ module TrinityMemoryBridgeSpec {
assert TMS_HTTP_OK == 200 && TMS_HTTP_BAD_REQUEST == 400 && TMS_HTTP_FORBIDDEN == 403 && TMS_HTTP_METHOD_NOT_ALLOWED == 405
&& TMS_HTTP_PAYLOAD_TOO_LARGE == 413 && TMS_HTTP_UNSUPPORTED_MEDIA_TYPE == 415 && TMS_HTTP_HEADERS_TOO_LARGE == 431;
}
invariant evidence_mask_is_the_sum_of_its_four_fields {
assert TMS_BRIDGE_EVIDENCE_REQUIRED == (TMS_BRIDGE_EVIDENCE_BITSTREAM | TMS_BRIDGE_EVIDENCE_CAPTURE
| TMS_BRIDGE_EVIDENCE_IDCODE | TMS_BRIDGE_EVIDENCE_DNA);
}

// Tests execute in the generated C test runner.
test "request size and json validity decide the http status" {
Expand Down Expand Up @@ -412,4 +459,18 @@ module TrinityMemoryBridgeSpec {
assert tms_bridge_request_capacity(2097152) == 2162688;
assert tms_bridge_response_capacity(524288, 1000000) == 41064960;
}
test "the emulator is the default and the device backend needs its transport" {
assert tms_bridge_backend_valid(0) && tms_bridge_backend_valid(1);
assert !tms_bridge_backend_valid(2);
assert !tms_bridge_backend_is_hardware(0) && tms_bridge_backend_is_hardware(1);
assert tms_bridge_transport_valid(0, 0) && !tms_bridge_transport_valid(0, 1);
assert tms_bridge_transport_valid(1, 1) && !tms_bridge_transport_valid(1, 0);
}
test "the device backend requires the whole evidence block and the emulator none" {
assert tms_bridge_evidence_valid(0, 0) && !tms_bridge_evidence_valid(0, 15);
assert tms_bridge_evidence_valid(1, 15) && !tms_bridge_evidence_valid(1, 0);
assert !tms_bridge_evidence_valid(1, 7) && !tms_bridge_evidence_valid(1, 31);
// 0x3636093 in decimal digits: the Artix-7 XC7A200T of the AX7203.
assert tms_bridge_idcode_valid(56762515) && tms_bridge_idcode_valid(1) && !tms_bridge_idcode_valid(0);
}
}
Loading