Possible infinite loop for bad generators

Open Beginner friendly
#216 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
69/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp
Domain
compilers

Research direction

Start with the retry loop in include/trieste/wf.h at lines 438–443, linked from the issue, and read how it generates names and handles bindings that disallow shadowing. Check the relevant tests for name generation and add coverage for a finite generator whose names are already used. Done when retries are capped and that case terminates; the issue does not specify the cap.

Written by the indexing model from the issue text.

Description

As brought up by Copilot's review of #209, there is a loop that continues to try and generate a fresh name until it succeeds:

https://github.com/microsoft/Trieste/blob/ff2acc317bda025210b1400d20e19a41f8349da5/include/trieste/wf.h#L438-L443

With a generator that only generates a finite set of names, and for a binding that doesn't allow shadowing, this loop will never terminate. We should probably cap the number of retries in this loop.

Dominant language
C++
Stars
53
Forks
29
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/Trieste

All issues in microsoft/Trieste

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.