You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
engine: complete the finite-set lattice, and seam off the representation
Q_PAGE_OFFSET is about to become a finite set on most architectures. Two
things had to be true first, and neither was.
estimate_meet handled only C_EQUALS on LK_FINSET. Both bounds and C_EXCLUDE
were accepted and discarded, so a measured bound would have narrowed nothing
and "the compile-time split is ruled out" -- which is an exclude -- would have
been dropped by the lattice that most invites it. Every op now runs through
one constraint_admits() predicate applied to each live candidate. Its switch
has no default: deliberately, so a newly added op fails -Wswitch rather than
being silently ignored the way C_EXCLUDE was. n_candidates is bounded by the
bitmask width at compile time; the shift past a word is undefined, not merely
wrong.
`struct estimate` means different things per lattice -- on a finite set `lo`
is a live-candidate bitmask and `hi` is unused -- so the 51 sites reading .lo
and .hi were correct only for the lattice they were written against, which is
not a property of the source once the same file compiles both ways. They now
go through quantity_pinned/window/admits/narrowed, and check-lattice-seam
holds the line. It discovers the pointer alias from its binding rather than
assuming the `po` convention, so renaming cannot slip a read past.
Two of those sites were already lattice-aware and would have failed silently:
four rules gate on `kind != LK_INTERVAL` and would have gone inert on arm64
and riscv64, and the orchestrator's default_excluded test compared window
edges, which still calls an excluded interior value possible. Asking the
estimate is both representation-free and more correct.
test_kasld and test_render exercise engine_sync_authoritative, which projects
resolved estimates, so those single-TU builds now carry the value model they
read -- after orchestrator.c, whose feature-test macros must come first.
Copy file name to clipboardExpand all lines: docs/testing.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,6 +108,7 @@ and `make` halts on the first.
108
108
|`check-text-floor`| no component rolls its own text-base floor — they must use the `api.h` helper |
109
109
|`check-shellcheck`| shellcheck over the `extra/` helper scripts |
110
110
|`check-confidence-floor`| no engine rule pins the *guaranteed* window from a guess — a sub-floor signal may shape `likely` only, outside the reviewed allowlist |
111
+
|`check-lattice-seam`| quantities whose lattice varies by architecture (`Q_PAGE_OFFSET`, `Q_VA_BITS`) are read through `quantity_pinned/window/admits/narrowed`, never through `.lo` / `.hi`. `struct estimate` means different things per lattice — on a finite set `lo` is a live-candidate bitmask and `hi` is unused — so a direct read is correct only for the lattice it was written against, which is not a property of the source when the same file compiles both ways. Nothing would fail loudly: a bitmask read as an address is a small integer, so the result is a plausible wrong answer rather than a crash. The pointer alias is discovered from its binding rather than assumed to be named `po`, so renaming it cannot slip a read past |
111
112
|`check-text-region`| the `KERNEL_TEXT` vs `KERNEL_IMAGE` base contract holds — only reviewed emitters may publish a `_stext` base |
112
113
|`check-image-size`| the kernel image size is read only through the evidence accessors, never re-derived in a component |
113
114
|`check-hash-parity`| every hashed offset-table row's key recomputes to the stored value under the shipped `kasld_fnv1a64()`, so the runtime hash and the offline generator's cannot drift apart |
0 commit comments