Skip to content

Improve SymbExLogger#622

Merged
mschwerhoff merged 36 commits into
viperproject:masterfrom
pieter-bos:master
Nov 30, 2022
Merged

Improve SymbExLogger#622
mschwerhoff merged 36 commits into
viperproject:masterfrom
pieter-bos:master

Conversation

@pieter-bos

Copy link
Copy Markdown
Contributor

A first attempt at some changes to symbexlogger I'd like to see:

  • SymbLog doesn't write records into memory directly, but rather does so via a SymbLogListener, so VerCors can listen to the events directly instead of polling the log. Additionaly I don't think we need the history of all records.
  • I made SymbLog thread safe up to parallelization of entities, as far as I understand that's the current state of silicon (?). If this can be left in I'd be inclined to turn on logging by default if the performance penalty is not too great.

Of course happy to address any comments :)

Pieter Bos added 2 commits June 8, 2022 13:40
- Thread safe as long as silicon parallelizes up to the entity level: SymbLog itself is not thread safe. --ideModeAdvanced accordingly does not require --numberOfParallelVerifiers 1 anymore.
- Change SymbLog to accept a listener for appropriate events.
@ArquintL ArquintL self-requested a review June 9, 2022 15:18
Comment thread src/main/scala/decider/ProverStdIO.scala Outdated
@mschwerhoff

Copy link
Copy Markdown
Contributor

Regarding thread safety: Generally a good idea, but it seems a bit dangerous to make one logging/reporting component thread-safe, while many others still are not. I don't have a strong opinion here, though, and since you already did the work ... :-)

@mschwerhoff

Copy link
Copy Markdown
Contributor

Is this work in progress or should it be reviewed? In the former case, please convert to a draft (I've actually never used that GitHub feature, but since it exists ...).

@pieter-bos

Copy link
Copy Markdown
Contributor Author

This is ready for review! Sorry, did not know if I should re-ping you.

@mschwerhoff

Copy link
Copy Markdown
Contributor

Re-pinging is always a good idea :-) I'll do a review after my holiday, i.e. mid/end August.

@pieter-bos pieter-bos deleted the branch viperproject:master September 15, 2022 12:02
@pieter-bos pieter-bos closed this Sep 15, 2022
@pieter-bos pieter-bos deleted the master branch September 15, 2022 12:02
@pieter-bos pieter-bos restored the master branch September 15, 2022 12:03
@pieter-bos pieter-bos reopened this Sep 15, 2022
@mschwerhoff

Copy link
Copy Markdown
Contributor

@niomaster Please remove the merge conflicts first.

Also: why is a ``validateOpt(...)remove from fileConfig.scala`? Is that change from you?

@pieter-bos

Copy link
Copy Markdown
Contributor Author

I resolved the merge conflicts, and the validateOpt bit I removed checks that ideModeAdvanced ==> numberOfParallelVerifiers = 1, which is no longer necessary, since SymbExLogger is thread safe.

@mschwerhoff mschwerhoff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@ArquintL If you see a reason not to merge, please let me know. Otherwise, I'll merge at the end of the week.

@ArquintL ArquintL left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only have a minor comment but otherwise looks good to me too

Comment thread src/main/scala/logger/LogConfig.scala Outdated
@pieter-bos

Copy link
Copy Markdown
Contributor Author

Just in case: I'm working on making the logger externally parallelizable (as is silicon now) as promised in #660 (comment), so please don't merge this right now.

Pieter Bos added 5 commits November 17, 2022 11:39
The root symbexlog comes from Silicon and is computed explicitly on configuration, so it can be overridden
From there, the MainVerifier owns the root log, and WorkerVerifiers ask the MainVerifier for a member-scoped symbexlog
- do not use newEntityLogger directly, because it's not inserted in the members of the root log
- synchronize on the log instead of the map, because I'm using a var instead of mutable.Map
- delay opening the member scope to avoid using early initializers
@pieter-bos pieter-bos requested review from ArquintL and mschwerhoff and removed request for mschwerhoff November 18, 2022 11:29

@mschwerhoff mschwerhoff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks generally good, modulo the comments I left.

Comment thread src/main/scala/Config.scala
Comment thread src/main/scala/decider/Decider.scala
Comment thread src/main/scala/logger/SymbExLogger.scala Outdated
Comment thread src/main/scala/logger/SymbExLogger.scala
Comment thread src/main/scala/logger/SymbExLogger.scala Outdated
Comment thread src/main/scala/logger/records/data/FunctionRecord.scala
Comment thread src/main/scala/rules/Brancher.scala Outdated
Comment thread src/main/scala/rules/Consumer.scala Outdated
Comment thread src/main/scala/rules/Consumer.scala Outdated
Comment thread src/main/scala/verifier/WorkerVerifier.scala Outdated
@mschwerhoff

Copy link
Copy Markdown
Contributor

@niomaster FYI: We just started preparing the Januar release of Viper, and would be happy to include your changes.

@pieter-bos

Copy link
Copy Markdown
Contributor Author

I've addressed all the comments!

@mschwerhoff mschwerhoff self-requested a review November 30, 2022 12:41

@mschwerhoff mschwerhoff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@mschwerhoff

Copy link
Copy Markdown
Contributor

@marcoeilers Linard and I reviewed the PR. Any objections from your side to merge it in now?

@marcoeilers

Copy link
Copy Markdown
Contributor

No objections, looks good to me.

@mschwerhoff mschwerhoff merged commit 3f6aaa9 into viperproject:master Nov 30, 2022
@mschwerhoff

Copy link
Copy Markdown
Contributor

@niomaster Thanks a lot for your contribution to Viper, Pieter!

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