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

Concurrent kore-rpc server #3704

Merged
merged 10 commits into from
Dec 14, 2023
Merged

Concurrent kore-rpc server #3704

merged 10 commits into from
Dec 14, 2023

Conversation

goodlyrottenapple
Copy link
Contributor

@goodlyrottenapple goodlyrottenapple commented Dec 12, 2023

Implements the proposal from runtimeverification/hs-backend-booster#383

Namely:

add-module

  • now returns the id of a given module, of the form m<sha256_of_given_module>
  • computes the SHA256 hash of the unparsed module string and saves the internalised module under this key
  • takes an optional name-as-id: true argument which implements the previous behaviour of add-module (still returns the new id), i.e. adds the module to the module map under the module name as well as the id.
  • if the same module is added twice with name-as-id: true, the second request will fail with a Duplicate module error
  • if the same module is sent twice with name-as-id: false or without name-as-id, the second request is idempotent and will succeed

As discussed on the issue, the IDs and original names are not disjoint for ease of implementation. the m pre-pended to the hash is necessary to make the name a valid kore identifier.

I have also not added the modules field to other methods as I'm unsure whether this should be replacing the current module parameter, which would be a backwards incompatible change to the API that would break a lot of our integration tests, or if it should be an additional field, @tothtamas28?

@goodlyrottenapple goodlyrottenapple requested review from jberthold and geo2a and removed request for jberthold December 12, 2023 17:24
kore/src/Kore/JsonRpc.hs Outdated Show resolved Hide resolved
@goodlyrottenapple goodlyrottenapple marked this pull request as ready for review December 13, 2023 11:10
@tothtamas28
Copy link
Contributor

tothtamas28 commented Dec 14, 2023

if the same module is added twice with name-as-id: true, the second request will fail with a Duplicate module error

I think the Duplicate module error is only necessary if the modules are not the same (but the names are). Otherwise, the request can be idempotent.

I have also not added the modules field to other methods

Does this mean that the modules are still added globally, but now the unique ID's work for module imports? If so, that's reasonable, we can tackle the breaking changes in the new year.

@goodlyrottenapple
Copy link
Contributor Author

I think the Duplicate module error is only necessary if the modules are not the same (but the names are). Otherwise, the request can be idempotent.

Ok, will make that change

Does this mean that the modules are still added globally, but now the unique ID's work for module imports? If so, that's reasonable, we can tackle the breaking changes in the new year.

Yes all modules are added globally and you can send in a module that imports other modules via their ID.

@goodlyrottenapple goodlyrottenapple merged commit 4e9fb7a into master Dec 14, 2023
7 checks passed
@goodlyrottenapple goodlyrottenapple deleted the sam/concurrent-kore branch December 14, 2023 14:22
geo2a added a commit that referenced this pull request Dec 19, 2023
geo2a added a commit that referenced this pull request Dec 20, 2023
Reverts
#3704.

We would like to update the `haskell-backend` version used in
[hs-backend-booster](https://github.com/runtimeverification/hs-backend-booster/)
in order to merge
runtimeverification/hs-backend-booster#421. We
cannot have
#3704
(concurrent `kore-rpc`), because we will need to merge
runtimeverification/hs-backend-booster#427
(concurrent `kore-rpc-booster`). We do not want to merge the concurrent
`kore-rpc-booster` PR before the Holiday break, since it is a braking
change for `pyk`.

The reverted PR will need to be reopened. I think it is best to merge it
in sync with
runtimeverification/hs-backend-booster#427,
preparing a relevant change to `pyk` in advance.
@geo2a geo2a restored the sam/concurrent-kore branch December 20, 2023 09:11
goodlyrottenapple added a commit that referenced this pull request Jan 24, 2024
This is a revert of the revert of
#3704. Needs
to be merged in sync with
runtimeverification/hs-backend-booster#427 and
also a change to `pyk` to handle the new modules IDs.

---------

Co-authored-by: Sam Balco <[email protected]>
Co-authored-by: github-actions <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants