interplane.Get Omega
Read in your language

omnet

aien-dev/omnet

Brought by drakestapleton

branch main Branches Tags History

omnet / om / quantity / README.md

55 lines · 3275 bytes Raw Blame History Rendered
1# Checked quantities (SC1-Q)
2
3Apache-2.0 source imported byte-for-byte from Omega's `om/quantity/` proposal
4[#771](https://github.com/aien-dev/omega-mv/pull/771), not a second implementation.
5The `q` function prefix names this unit. Compiler pin is unchanged.
6
7`qty {val,cap}` distinguishes bounded quantities from modular scalar words;
8`qobj {ident,ver,extent}` and `qslic {ident,ver,off,count}` bind a view to an
9owner-assigned nonreused object/version, not an fd number. Raw fields remain
10trusted construction boundaries, not sealed capabilities or physical units.
11
12All calls return int:0 success,1 malformed input,2 domain mismatch/negative signed
13ingress/widening through narrow,3 overflow/underflow,4 object mismatch. Refusal
14leaves output unchanged. Output/input structs must be distinct (seed alias rule).
15
16- `qword`, `qsigned`: validate original ingress before conversion/effects.
17- `qadd`, `qsub`, `qmul`: validate both inputs/equal caps before guarded arithmetic.
18- `qnarrow`: target cap cannot exceed source cap; value must fit.
19- `qnext`: refuse cap exhaustion; no wrapping policy epoch.
20- `qtyslice`: validate expected/current identity, version, extent, then offset and
21 count by subtraction before address formation.
22
23A constructor applied after a wrapped sum cannot recover the original operands.
24Revalidate serialized slices from original offset/count against the trusted current
25object immediately before effects. Same caps do not distinguish application units.
26
27Actual consumer: `dsframe` and `dsio` validate decoded lengths and cursor arithmetic
28before socket effects; `dsgrow` checks positive signed syscall results before
29conversion and checked addition. `dsbound` rechecks final response length, but it
30cannot prove that all upstream response-writer arithmetic was checked. The remaining
31producer/effect inventory is in `qualification/security3-consumer/quantities.json`.
32
33## Qualification
34
35The imported runtime fixtures cover widths1..8, u64 wrapping products, negative
36input, narrowing, object/version mismatches, unchanged refusal outputs and epoch
37exhaustion. Four mixed nominal fixtures must compile-refuse7; crypto wrapping
38must execute0. The exact-source add/mul guard mutants must compile and normally
39fail their named assertions. `oracle-export.om` emits262140 actual records for
40external exact-arithmetic comparison; raw corpus evidence lives in Omega #771.
41These are finite/native tests, not a language-wide or translation theorem.
42
43`sh om/quantity/test/run.sh` is registered by the existing `tools/test.sh` glob.
44It only bootstraps the pinned compiler and executes the existing security3 `.om`
45coordinator. All selection, source composition, mutation, exit/output checks and
46verdicts are in `qualification/security3/run.om --consumer-units`, not shell.
47That mode also exercises actual transport/no-op and secret-comparison fixtures;
48see `qualification/security3/README.md` for exact commands and retained results.
49
50## Third-party material and notices
51
52No third-party algorithm or vector text is copied into this unit. Omega source is
53Apache-2.0, the same license as omnet. Imported deterministic fixtures are synthetic.
54The independent arbitrary-precision arithmetic oracle is a development tool, not
55shipped production/test-runner logic.