Skip to content

fix: prevent duplicate party assignment in assign_implicit_party#728

Merged
alex9849 merged 5 commits into
fandango-fuzzer:mainfrom
zyt600:fix/assign-implicit-party
May 7, 2026
Merged

fix: prevent duplicate party assignment in assign_implicit_party#728
alex9849 merged 5 commits into
fandango-fuzzer:mainfrom
zyt600:fix/assign-implicit-party

Conversation

@zyt600
Copy link
Copy Markdown
Contributor

@zyt600 zyt600 commented Nov 15, 2025

For example, in smtp-telnet.fan:

<start> ::= <Out:telnet_intro> <smtp>
<smtp> ::= <Out:m220> <In:quit> <Out:m221>

When a non-terminal symbol (e.g., <smtp>) in a grammar rule lacks explicit party annotations, the assign_implicit_party function automatically assigns the default StdOut party to it. However, this can cause nested party issues when the rule definition already contains party definitions in its child nodes.

The <smtp> non-terminal itself has no party annotation, but its children (<Out:m220>, <In:quit>, <Out:m221>) already have explicit party definitions. Without this fix, <smtp> would be assigned StdOut, creating an illegal nested party structure.

Solution

Added a check in assign_implicit_party to skip assigning an implicit party when the rule definition of a non-terminal already contains party definitions. This prevents overwriting existing party assignments and avoids nested party errors.

Add check to skip assigning implicit party when the rule definition already contains party definitions. This prevents overwriting existing
party assignments in grammar rules.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 15, 2025

🐰 Bencher Report

Branchfix/assign-implicit-party
Testbedubuntu-latest
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
tests/test_benchmarks.py::test_generate_with_single_hard_constraint📈 view plot
🚷 view threshold
1,801.65 ms
(-3.12%)Baseline: 1,859.71 ms
2,139.78 ms
(84.20%)
tests/test_benchmarks.py::test_generate_with_single_soft_constraint📈 view plot
🚷 view threshold
51,153.52 ms
(-3.33%)Baseline: 52,914.16 ms
79,972.04 ms
(63.96%)
tests/test_benchmarks.py::test_init_fandango📈 view plot
🚷 view threshold
119.15 ms
(-21.40%)Baseline: 151.58 ms
161.89 ms
(73.60%)
tests/test_benchmarks.py::test_parse_spec📈 view plot
🚷 view threshold
119.85 ms
(-21.76%)Baseline: 153.17 ms
160.36 ms
(74.74%)
🐰 View full continuous benchmarking report in Bencher

@joszamama joszamama requested a review from alex9849 November 18, 2025 16:18
@joszamama joszamama self-assigned this Nov 18, 2025
@alex9849 alex9849 merged commit c955649 into fandango-fuzzer:main May 7, 2026
33 checks passed
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