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

Refactor P4Testgen strategies - Part 1. Add a new strategy - greedy search. #3878

Merged
merged 14 commits into from
Mar 14, 2023

Conversation

fruffy-bfn
Copy link
Contributor

@fruffy-bfn fruffy-bfn commented Feb 6, 2023

  • Add a lookahead visitor to P4Testgen. This visitor collects the statements that could potentially be visited for a particular statement. These latent statements are added to the branch state and are consumed by some strategies. The difference of this visitor to the normal coverage visitor is that it fully traverses the parser DAG.
  • The lookahead visitor needs to be applied manually in crucial spots. For example, when a table adds an action, or when an if statements adds a branch. I have not found a better solution for this particular lookahead yet.
  • Only add statements if their source info is valid. This implies that they can be found in the original P4 program.
  • Introduce a new strategy - greedy potential (name is tentative). This strategy greedily selects the first execution state that may cover a new statement in the program.
  • Improve the way performance reports are generated - use an inja template.
  • Add a plotting script to the benchmarking folder. Refactor the coverage script.

There will be a second part, which brings some of the improvements of the new strategy to existing strategies. The second part will also rename the strategies appropriately.

@fruffy-bfn fruffy-bfn force-pushed the strategies branch 11 times, most recently from 622105a to 102bcfb Compare February 8, 2023 15:12
@fruffy fruffy force-pushed the strategies branch 2 times, most recently from 09d5d48 to 636a8df Compare February 19, 2023 01:13
@fruffy fruffy added the p4tools Topics related to the P4Tools back end label Feb 21, 2023
@fruffy fruffy force-pushed the strategies branch 10 times, most recently from e39a01b to 3a66e05 Compare March 6, 2023 14:59
@fruffy fruffy changed the title Fixes for P4Testgen strategies. Refactor P4Testgen strategies - Part 1. Add a new strategy - greedy search. Mar 6, 2023
@fruffy fruffy marked this pull request as ready for review March 6, 2023 16:48
@fruffy fruffy requested a review from mihaibudiu as a code owner March 6, 2023 16:48
@jnfoster
Copy link
Contributor

jnfoster commented Mar 6, 2023

Did you intend to include plotting scripts?

@fruffy
Copy link
Collaborator

fruffy commented Mar 6, 2023

Did you intend to include plotting scripts?

Yes

Copy link
Contributor

@jnfoster jnfoster left a comment

Choose a reason for hiding this comment

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

LGTM

@fruffy fruffy merged commit 9a92aa0 into p4lang:main Mar 14, 2023
@fruffy-bfn fruffy-bfn deleted the strategies branch March 23, 2023 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4tools Topics related to the P4Tools back end
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants