Repository navigation
Conversation
…ents
Rule 3 of CLAUDE.md: the spec and the statements first, before the exec
kernel and the proofs.
spec.rs: GpuExited { id } (the host's), GpuSoftware (--gpu=software, and
the declassified part of another domain's refusal), GpuSiteExit { lock }
(the declassified part of another domain's hardware exit); the outputs
GpuStopped (rule 4's notice) and GpuAllSoftware (to the host);
Policy::GpuSoftware; the state's GpuState (a record per renderer, the
every-tab bit, the recent sites); the window (300 s), exits (3) and sites
(3) stated once; gpu_exited with the four rules; GpuReady marks the
record running, and a FrameReady paints only from a running record.
domain.rs and noninterference.rs: GpuExited belongs to its renderer's
domain; its declassified part is GpuSoftware or GpuSiteExit; rel gains
the shared bit and sites and the observer's records; the
gpu_declassify_statement.
statements.rs: theorem_gpu_exit_contained, theorem_gpu_restart_bounded,
theorem_site_cannot_demote_others (with gpu_sites_wf kept),
theorem_paint_after_restart; theorem_channel_only_own_tab restated with
the restart. gpu_theorems.rs holds the contracts, without proofs yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
exec/gpu.rs: the records, gpu_exited, GpuSoftware and GpuSiteExit over exec records, each proven equal to its spec; from_gpu paints only from a running record and GpuReady marks it; step_exec dispatches the new events. The host (crates/clazel, text mode) ignores the new outputs. gpu_theorems.rs proves theorem_gpu_exit_contained, theorem_gpu_restart_bounded, theorem_site_cannot_demote_others, theorem_gpu_sites_wf_kept and theorem_paint_after_restart. gpu_rel.rs proves the noninterference cases: a domain's own GpuExited is the same in both runs, GpuSoftware and GpuSiteExit are kept for every observer, and lemma_gpu_declassify: another domain's GpuExited does to the observer exactly what its declassified part does. Every earlier theorem is re-proven over the new events and outputs: the frame lemmas and the rel builders gain the crash policy's state, and three rlimits are raised. gpu_exited is split into the lookup and gpu_exit_of (same meaning). Verus, clazel-kernel: 846 verified, 0 errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/gpu_policy.rs: rules 1 to 4 row by row, the refusal in hardware and
in software, the window (299 and 300 seconds), three exits, three sites
(and one site's many tabs, and sites 300 seconds apart), the host's
GpuSoftware told once, GpuReady { software: true } from hardware, no
paint after an exit until GpuReady, an unknown id, and the declassified
site count. behaviour.rs: a frame paints only after GpuReady.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Twelve mutations, each certified killed by a lemma in mutation_lemmas.rs that states the rule with its number written out: the window shorter and longer (299, 301), four exits, rule 2 gone, rule 4 gone, four and two sites, a site counting its own exit, a refusal restarted in hardware, a frame painted before GpuReady, GpuReady not marking the record running, and a restart of another renderer's GPU process. The README's 5.17c section: decisions, theorems, which copy of the policy is the specification, and what is not done. exec/gpu.rs drops a lint override cargo xtask check rejects. Verus, clazel-kernel: 855 verified, 0 errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on
claude/style-fetches(items 5.18 and 5.19, tip261a1215). Base this PR on that branch, and merge it after.CI has not run.
cargo xtask verifywas not run in any form. Everything below is from local runs.What
The part of Phase 5 item 5.17c that waited for the kernel.
GpuReady { software }andGpuRefusednow mean something; there is a new host event,GpuExited; and the item's four rules are in the kernel's spec, proven, with the numbers stated once:gpu_window(300 s),gpu_exits(3),gpu_sites(3).GpuExited { id }(the host's).GpuSoftware(the host's--gpu=software).GpuSiteExit { lock }. The host never sends it: it is the declassified part of another domain's exit.GpuStopped { tab, url }(rule 4's notice).GpuAllSoftware(to the host, once).Policy::GpuSoftware.GpuState, holding a record per renderer, the every-tab bit, and the two most recent sites.Commits:
Decisions (all in
src/spec.rs's header and the kernel README)GpuExited { id }, not the item's{ tab }. Keyed by id, an exit of a replaced GPU process names no live renderer and is ignored.now, in seconds, from the host'sTick.Spawn { id, Gpu }, so no 5.18 output changes.Policy::Gpumeans the run's mode.GpuAllSoftwareonce, after which the host starts everyGpuprocess in software.Domain). The kernel keeps the two most recent distinct sites.GpuReadyin hardware puts every tab in software, and is not counted by site.GpuRefuseditself changes nothing; the exit that follows is the refusal.GpuReadyin software is rule 4.GpuReady { software: true }from a hardware start marks the record as software.GpuReady.Noninterference
theorem_cookie_noninterferencekeeps its form. What changed:GpuExitedbelongs to its renderer's domain, as that renderer's frames do.GpuSoftware, for an exit beforeGpuReadyin hardware (a refusal);GpuSiteExit { lock }, for a hardware exit while drawing: the site's lock goes into the shared count, and at most one bit, every tab to software, comes out;lemma_gpu_declassifyproves this.Evidence
Verus, local, macOS arm64, one run at a time under
.git/kani.lock, each capped at 30 min and 8 GB:clazel-kernel: 855 verified, 0 errors, wall 56 s, peak 3.1 GB. Before this item it was 780.Theorems, all proven and all listed in
Cargo.toml:theorem_gpu_exit_contained: a GPU exit changes only the crash policy's state, and no record but its own renderer's. Every output is for that renderer or its tab, or is the host'sGpuAllSoftware.theorem_gpu_restart_bounded, with 300 s and two exits written out: a restart in the same mode happens only if the record does not hold two exits with the older within 300 s, and the record is then updated exactly. A mode change records no exits.theorem_site_cannot_demote_others, withtheorem_gpu_sites_wf_kept: every tab goes to software only through one of these:GpuSoftware;GpuReady;theorem_paint_after_restart: 5.18's paint theorems restated over restarts.theorem_channel_only_own_tab, restated to allow the restart.relbuilders gained the crash policy's state;rlimits were raised;gpu_exitedwas split into the lookup andgpu_exit_of, with the same meaning.Mutations, each run alone under the lock with
cargo xtask mutate:gpu-window-shorter,gpu-window-longer(299 s, 301 s);gpu-exits-four;gpu-rule2-never,gpu-rule4-never;gpu-sites-four,gpu-sites-two;gpu-site-counts-own;gpu-refusal-hardware;gpu-paint-before-ready;gpu-ready-not-running;gpu-restart-other-id.paint-tab-is-renderer-id,resize-to-next-gpu,replace-without-gpu.findstrings still each match exactly once, and noexpectwas changed.Tests and checks:
cargo test -p clazel-kernel -j 4: 59 passed, 0 failed. This includes the newtests/gpu_policy.rswith 14 rows: rules 1 to 4, the refusal in hardware and in software, the 299 s and 300 s edges, one site with many tabs, sites 300 s apart,GpuSoftwaretold once, a software-onlyGpuReady, no paint after an exit untilGpuReady, an unknown id, and the declassified count.behaviour.rsupdated: a frame now paints only afterGpuReady.cargo clippy --workspace --all-targets --locked -- -D warnings: clean.cargo fmt --all -- --check: clean.cargo xtask check: STATIC CHECKS PASSED.Which copy of the policy is the specification
The kernel's
src/spec.rsis the specification.clazel-gpu'ssrc/policy.rslives onclaude/gpu-fallback-cfed1c, which this branch does not contain (there is noclazel-gpuhere). The two models differ:fallbackconfig there, which is the host's here;So agreement cannot be shown without rewriting one of them.
Recommended at the join: remove
policy.rsand its Kani harnesses fromclazel-gpu, keeping only the start answer and the blocklist there. This branch does not do the join.The kernel README says this.
clazel-gpu's README is not on this branch. The paragraph to add to it at the join:Not done, not verified
GpuExited,Policy::GpuSoftware,GpuAllSoftwareandGpuStoppedare unused until the window (5.20 to 5.23). Keeping the list channel's GPU end for restarts is also unbuilt.full-verificationreviewer's approval.🤖 Generated with Claude Code