Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run TLA+ consensus/consistency from vscode #6490

Closed
heidihoward opened this issue Sep 20, 2024 · 6 comments
Closed

Run TLA+ consensus/consistency from vscode #6490

heidihoward opened this issue Sep 20, 2024 · 6 comments
Labels
tla TLA+ specifications

Comments

@heidihoward
Copy link
Member

heidihoward commented Sep 20, 2024

At the moment, users cannot run the TLA+ specs in codespaces out of the box due to the shared StatsFile.tla. It would be great if we could support this, we have at least three options:

  • Remove StatsFile.tla as this was mostly used for cimetrics
  • Duplicate StatsFile.tla between the consensus and consistency directories
  • (If possible) Modify the devcontainer settings so the TLA+ vscode plugin knows to look in /tla for the modules

We would also need to add tlc2.tool.impl.Tool.cdot=true to the devcontainer

@heidihoward heidihoward added the tla TLA+ specifications label Sep 20, 2024
@lemmy
Copy link
Contributor

lemmy commented Sep 20, 2024

At the moment, users cannot run the TLA+ specs in codespaces out of the box due to the shared StatsFile.tla. It would be great if we could support this, we have at least three options:

  • Remove StatsFile.tla as this was mostly used for cimetrics
  • Duplicate StatsFile.tla between the consensus and consistency directories
  • (If possible) Modify the devcontainer settings so the TLA+ vscode plugin knows to look in /tla for the modules

The module StatsFile does not seem to be a dependency of the consistency spec anymore.

We would also need to add tlc2.tool.impl.Tool.cdot=true to the devcontainer

I recommend rewriting ccfraft without using cdot, as the incomplete implementation of cdot may lead to subtle issues under (non-trivial) refinement:

CCF/tla/consensus/ccfraft.tla

Lines 1101 to 1102 in 3cf06af

\/ ConflictAppendEntriesRequest(i, index, m) \cdot AppendEntriesAlreadyDone(i, j, index, m)
\/ ConflictAppendEntriesRequest(i, index, m) \cdot NoConflictAppendEntriesRequest(i, j, m)

lemmy added a commit to lemmy/CCF that referenced this issue Oct 2, 2024
Part of "Run TLA+ consensus/consistency from vscode" microsoft#6490

microsoft#6490
Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
lemmy added a commit to lemmy/CCF that referenced this issue Oct 2, 2024
Part of "Run TLA+ consensus/consistency from vscode" microsoft#6490

microsoft#6490
Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
@achamayou
Copy link
Member

@heidihoward is this still an issue with StatsFile.tla gone?

In general, it's relatively straightforward to guarantee that things we run in the CI are reproducible by users (modulo unfortunately the stuff that requires Azure resources like the SNP tests): they can pull the image and run the same commands. Checking that something works in VS Code is not something we can practically check in CI, as far as I can tell.

@heidihoward
Copy link
Member Author

There's now a new challenge as the environment variables introduced last week need to be set

@achamayou
Copy link
Member

@heidihoward they don't need to, need to, because the current behaviour is to set defaults if they're missing. It'd be nice to be able to provide them through VS Code, I agree, which sounds like a feature request for the extension maybe?

@achamayou
Copy link
Member

The invocation seems to set the environment, to provide cwd, but allows no other env var customisation: https://github.com/tlaplus/vscode-tlaplus/blob/35a53385b33c5374100e7c1bce10a9b8ead8ca59/src/tla2tools.ts#L157

@heidihoward
Copy link
Member Author

Just testing and it does work now (for default env vars)
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tla TLA+ specifications
Projects
None yet
Development

No branches or pull requests

3 participants