Skip to content

_iter_path_args WIP#233

Draft
pgiarrusso-sl wants to merge 2 commits intomainfrom
paolo/iter_path_args-tweak
Draft

_iter_path_args WIP#233
pgiarrusso-sl wants to merge 2 commits intomainfrom
paolo/iter_path_args-tweak

Conversation

@pgiarrusso-sl
Copy link
Copy Markdown
Contributor

@pgiarrusso-sl pgiarrusso-sl commented Feb 23, 2026

I was reviewing this code, and naively this change seems necessary — hence the PR.

Tests pass, so test coverage is insufficient.

@rlepigre-skylabs-ai can tell if the change is appropriate.

@skylabs-ai-ci
Copy link
Copy Markdown

skylabs-ai-ci Bot commented Feb 23, 2026

CI summary (Details)

Active Repos

Repo Job Branch Job Commit Base commit PR
fmdeps/rocq-agent-toolkit/ paolo/iter_path_args-tweak af2abda a3cba03 #233

Passive Repos

Repo Job Branch Job Commit
./ main 014bde5
fmdeps/BRiCk/ main 4ce7328
fmdeps/auto/ main f336ece
fmdeps/auto-docs/ main 9f57097
bluerock/NOVA/ skylabs-proof 927947d
bluerock/bhv/ skylabs-main 5a39ba2
fmdeps/brick-libcpp/ main 53842f7
fmdeps/ci/ main d5ff6c5
vendored/elpi/ skylabs-master aa4475f
fmdeps/fm-ci/ main 262fb04
fmdeps/fm-tools/ main 46ed5a6
psi/protos/ main 8fe3e7c
psi/backend/ main a33abee
psi/ide/ main 6b596cf
psi/data/ main 6c7fffd
vendored/rocq/ skylabs-master 2ede3c9
vendored/rocq-elpi/ skylabs-master 103a742
vendored/rocq-equations/ skylabs-main a8c4832
vendored/rocq-ext-lib/ skylabs-master 94a6630
vendored/rocq-iris/ skylabs-master 3ad4ddd
vendored/rocq-lsp/ skylabs-main a8b7272
vendored/rocq-stdlib/ skylabs-master bc07423
vendored/rocq-stdpp/ skylabs-master e01d802
fmdeps/skylabs-fm/ main 7d620c1
vendored/vsrocq/ skylabs-main 5b4527e

Performance

Relative Master MR Change Filename
+0.00% 122612.2 122612.2 +0.0 total
+0.00% 22464.3 22464.3 +0.0 ├ translation units
+0.00% 100147.9 100147.9 +0.0 └ proofs and tests
Full Results
Relative Master MR Change Filename
+0.00% 122612.2 122612.2 +0.0 total
+0.00% 22464.3 22464.3 +0.0 ├ translation units
+0.00% 100147.9 100147.9 +0.0 └ proofs and tests

Comment thread rocq-dune-util/src/rocq_dune_util/rocq_dune_util.py
@pgiarrusso-sl pgiarrusso-sl force-pushed the paolo/iter_path_args-tweak branch from 690a0ca to 2d95179 Compare February 23, 2026 04:23
@skylabs-ai-ci
Copy link
Copy Markdown

skylabs-ai-ci Bot commented Feb 23, 2026

CI summary (Details)

Active Repos

Repo Job Branch Job Commit Base commit PR
fmdeps/rocq-agent-toolkit/ paolo/iter_path_args-tweak ce0defc a3cba03 #233

Passive Repos

Repo Job Branch Job Commit
./ main 014bde5
fmdeps/BRiCk/ main 4ce7328
fmdeps/auto/ main f336ece
fmdeps/auto-docs/ main 9f57097
bluerock/NOVA/ skylabs-proof 927947d
bluerock/bhv/ skylabs-main 5a39ba2
fmdeps/brick-libcpp/ main 53842f7
fmdeps/ci/ main d5ff6c5
vendored/elpi/ skylabs-master aa4475f
fmdeps/fm-ci/ main 262fb04
fmdeps/fm-tools/ main 46ed5a6
psi/protos/ main 8fe3e7c
psi/backend/ main 441bdce
psi/ide/ main 6b596cf
psi/data/ main 6c7fffd
vendored/rocq/ skylabs-master 2ede3c9
vendored/rocq-elpi/ skylabs-master 103a742
vendored/rocq-equations/ skylabs-main a8c4832
vendored/rocq-ext-lib/ skylabs-master 94a6630
vendored/rocq-iris/ skylabs-master 3ad4ddd
vendored/rocq-lsp/ skylabs-main a8b7272
vendored/rocq-stdlib/ skylabs-master bc07423
vendored/rocq-stdpp/ skylabs-master e01d802
fmdeps/skylabs-fm/ main 7d620c1
vendored/vsrocq/ skylabs-main 5b4527e

Performance

Relative Master MR Change Filename
-0.00% 122612.2 122612.2 -0.0 total
-0.00% 22464.3 22464.3 -0.0 ├ translation units
+0.00% 100147.9 100147.9 +0.0 └ proofs and tests
Full Results
Relative Master MR Change Filename
-0.00% 122612.2 122612.2 -0.0 total
-0.00% 22464.3 22464.3 -0.0 ├ translation units
+0.00% 100147.9 100147.9 +0.0 └ proofs and tests

Comment thread rocq-dune-util/src/rocq_dune_util/rocq_dune_util.py Outdated
@rlepigre-skylabs-ai
Copy link
Copy Markdown
Contributor

Actually, I don't think we have any test coverage for this. I couldn't find a good approach for testing, so this was tested manually. You might want to confirm that things are not broken before merging this @pgiarrusso-sl. One way to test this is with uv run python -i src/rocq_dune_util/rocq_dune_util.py and to check the output of something like:

try:
    rocq_args_for(
        "../../BRiCk/ltac2-logger/theories/logger.v",
        cwd=Path("../../auto"),
        plugins=[DuneRocqPlugin(opam_pkg="rocq-goal-to-json", entry_points=["basic/theories/goal_util.v"])]
    )
except DuneRocqPluginNotFound as e:
    print(e)

@pgiarrusso-sl
Copy link
Copy Markdown
Contributor Author

In a meeting, Rodolphe confirmed this is right but the "bug" gets usually hidden.

Co-authored-by: Rodolphe Lepigre <rodolphe.lepigre@skylabs-ai.com>
@skylabs-ai-ci
Copy link
Copy Markdown

skylabs-ai-ci Bot commented Feb 23, 2026

CI summary (Details)

Active Repos

Repo Job Branch Job Commit Base commit PR
fmdeps/rocq-agent-toolkit/ paolo/iter_path_args-tweak b81f54c 3ca376e #233

Passive Repos

Repo Job Branch Job Commit
./ main 57d9592
fmdeps/BRiCk/ main f324984
fmdeps/auto/ main b5395a0
fmdeps/auto-docs/ main 9f57097
bluerock/NOVA/ skylabs-proof 927947d
bluerock/bhv/ skylabs-main 5a39ba2
fmdeps/brick-libcpp/ main 53842f7
fmdeps/ci/ main d5ff6c5
vendored/elpi/ skylabs-master aa4475f
fmdeps/fm-ci/ main 262fb04
fmdeps/fm-tools/ main 46ed5a6
psi/protos/ main 8fe3e7c
psi/backend/ main 87bc3c1
psi/ide/ main 6b596cf
psi/data/ main 6c7fffd
vendored/rocq/ skylabs-master 2ede3c9
vendored/rocq-elpi/ skylabs-master 103a742
vendored/rocq-equations/ skylabs-main a8c4832
vendored/rocq-ext-lib/ skylabs-master 94a6630
vendored/rocq-iris/ skylabs-master 3ad4ddd
vendored/rocq-lsp/ skylabs-main a8b7272
vendored/rocq-stdlib/ skylabs-master bc07423
vendored/rocq-stdpp/ skylabs-master e01d802
fmdeps/skylabs-fm/ main 7d620c1
vendored/vsrocq/ skylabs-main 5b4527e

Performance

Relative Master MR Change Filename
-0.00% 122626.7 122626.6 -0.0 total
-0.00% 22464.3 22464.3 -0.0 ├ translation units
+0.00% 100162.3 100162.3 +0.0 └ proofs and tests
Full Results
Relative Master MR Change Filename
-0.00% 122626.7 122626.6 -0.0 total
-0.00% 22464.3 22464.3 -0.0 ├ translation units
+0.00% 100162.3 100162.3 +0.0 └ proofs and tests

Comment on lines 132 to +144
def _iter_path_args(
args: list[str],
) -> Iterator[tuple[Literal["I"], str] | tuple[Literal["Q"], str, str]]:
nb_args = len(args)
for i in range(nb_args):
while i < nb_args:
opt = args[i]
if opt == "-I" and i < nb_args - 1:
yield ("I", args[i + 1])
if (opt == "-Q" or opt == "-R") and i < nb_args - 2:
yield ("Q", args[i + 1], args[i + 2])
i += 1
if opt == "-I" and i < nb_args:
yield ("I", args[i])
i += 1
if (opt == "-Q" or opt == "-R") and i < nb_args - 1:
yield ("Q", args[i], args[i + 1])
i += 2
Copy link
Copy Markdown
Contributor

@gmalecha-at-skylabs gmalecha-at-skylabs Mar 27, 2026

Choose a reason for hiding this comment

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

This might also work. If you manifest the iterator, then you can explicitly use next on it and advance it within the loop. I will note that this will raise an exception if the arguments are incorrect.

Suggested change
i += 2
def _iter_path_args(
args: list[str],
) -> Iterator[tuple[Literal["I"], str] | tuple[Literal["Q"], str, str]]:
it = iter(args)
for opt in it:
if opt == '-I':
yield ("I", next(it))
elif opt in ["-Q", "-R"]:
yield ("Q", next(it), next(it))

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