Skip to content

Latest commit

 

History

History
48 lines (39 loc) · 2.94 KB

HostModels.md

File metadata and controls

48 lines (39 loc) · 2.94 KB

Host models with the Python identity

The Vis repository keeps the models of the host: worker lifecycle, grant epochs, snapshot persistence, block execution, runtime activation and runtime selection. Those models name two abstract runtime slots, A and B, and no concrete runtime. This directory binds slot A to this runtime and checks the same models here.

  • GuestRuntimeIdentity.tla is the binding. It is the only module of that name on the module path, because the lock does not list the neutral one of Vis.
  • host-models.lock pins the Vis commit and the SHA-256 of each model file. scripts/check-tla downloads the files to ~/.cache/vis-tla/host-models/<commit>/ and refuses a file with a different digest.
  • Each Host<Model>.tla extends one pinned model. Each config is the Vis config for this slot. A config changes only together with the lock.

Facts that the binding states about this runtime:

  • The runtime ID is python and the state format is vis-python-package (package/session/vis-runtime.json, session.state.format_id).
  • The host audits the sandbox policy over RPC before a block of this runtime. HostSandboxGrantEpoch starts from that slot.
  • The host saves the state after a completed guest error of this runtime.
  • A session without a runtime ID gets this runtime.
Config Vis config Result Distinct states
HostWorkerLifecycle.cfg WorkerLifecycle.cfg PASS, exhaustive 5,439,960
HostSandboxGrantEpoch.cfg SandboxGrantEpoch.cfg PASS, exhaustive 1,303,328
mutants/HostSandboxGrantEpoch_NoAdmissionCheck.cfg mutants/SandboxGrantEpoch_NoAdmissionCheck.cfg FAIL FreshEntryAfterAckAndAudit 94,023
HostSandboxPersistence.cfg SandboxPersistence.cfg PASS, exhaustive 68
HostSandboxPersistence.manifest.cfg SandboxPersistence.manifest.cfg PASS, exhaustive 684
HostBlockExecution.cfg BlockExecution.cfg PASS, exhaustive 1,026
HostBlockExecution.evidence.cfg BlockExecution.evidence.cfg PASS, exhaustive 20
HostBlockExecution.rollback.cfg BlockExecution.rollback.cfg PASS, exhaustive 24
HostRuntimeActivation.cfg RuntimeActivation.cfg PASS, exhaustive 18
HostRuntimeActivation.cache.cfg RuntimeActivation.cache.cfg PASS, exhaustive 9
HostRuntimeSelectionPrompt.cfg RuntimeSelectionPrompt.cfg PASS, exhaustive 17
HostRuntimeSelectionPrompt.adversarial.cfg RuntimeSelectionPrompt.adversarial.cfg PASS, exhaustive 29,602

The state counts are equal to the counts of the neutral models in Vis. A different count after a new lock means that the config and the model differ.

Take a newer Vis commit

VIS_TLA_HOST_MODELS=<vis>/resources/tla/runtime scripts/check-tla --relock <commit> --only host/

Copy each changed Vis config to its file here, then run the command. Use a commit that is on the Vis main branch: the check without VIS_TLA_HOST_MODELS downloads it.