Skip to content

Allow passing configuration options to the bench command - #372

Open
Janno wants to merge 3 commits into
rocq-prover:masterfrom
Janno:janno/bench-variables
Open

Allow passing configuration options to the bench command#372
Janno wants to merge 3 commits into
rocq-prover:masterfrom
Janno:janno/bench-variables

Conversation

@Janno

@Janno Janno commented Jul 30, 2026

Copy link
Copy Markdown

This should allow writing commands like bench coq_opam_packages="a b c", eliminating the need to push temporary commits for bench configuration. The native bench branch in the parser is now gone as that can be written as bench coq_native now.

The commits are hopefully self-explanatory. I took the liberty to restructure the comment parsing code (commit #1) because the old code was quite confusing to me and the control flow seemed odd. We now commit to one command and if argument parsing fails or permissions are missing, we go straight to the error case.

The string parsing and the test cases are generated by LLMs. The rest of the code is handwritten.

The PR is a draft for three reasons:

  • Passing arbitrary variables to the bench job could be a security concern. I don't know the bench code well enough to say. We might want a whitelist? (EDIT: No change in security risk compared to setting arguments via new commits that change bench.sh)
  • I have no idea how to run all tests in the repo. A bunch of dependencies are not recorded (alcotest, ppx_expect) and adding them manually still brings me to a point where some kind of token is required. Disabling all that still produces failures in inline tests that I do not understand.
  • The bench command is entirely undocumented and with it being a bit more complex now I think we need documentation. (EDIT: I found the actual place where the bench command is documented (https://github.com/rocq-prover/rocq/wiki/Benchmarking) and since it is not in this repo, it does not affect the actual code changes.)

Janno added 3 commits July 30, 2026 11:17
This change technically changes the semantics of the matching because
the new algorithm commits to a `Some` branch before it checks
permissions and other conditions. If those fail, we go directly to the
failure case instead of trying to parse other commands.
This means instead of `bench native` we now have to write `bench coq_native`.
This works because arguments keys without values are mapped to `"yes"`
values.
@SkySkimmer

Copy link
Copy Markdown
Contributor

Passing arbitrary variables to the bench job could be a security concern

No more than pushing a PR where the script sets those variables and having the bot run it. That's why the bot bench command is only allowed for authorized people.

@Janno
Janno marked this pull request as ready for review July 31, 2026 10:25
@Janno

Janno commented Jul 31, 2026

Copy link
Copy Markdown
Author

I am undrafting this. Docs live elsewhere, there is no change in security risk, and judging by the contributing guide, I would need to do some serious work for testing that I do not have time for right now. I wonder if it isn't easier to merge it and revert the merge if anything goes wrong. (Assuming the changes look good to everyone.)

@Zimmi48

Zimmi48 commented Jul 31, 2026

Copy link
Copy Markdown
Member

The tests should have been fixed in #375. We could merge this other one first if we want to make sure that everything works fine.

@Zimmi48
Zimmi48 requested a review from lykimq July 31, 2026 12:51
@Zimmi48

Zimmi48 commented Jul 31, 2026

Copy link
Copy Markdown
Member

If you want, I can also do a test deployment of this branch so that you can test it in production before we merge.

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.

3 participants