Skip to content

fix(convertToQucsData): guard against out-of-bounds for extra_vars_dims#1550

Merged
ra3xdh merged 2 commits into
ra3xdh:currentfrom
tskaar:dev/ts/fix-issue-1526
Dec 20, 2025
Merged

fix(convertToQucsData): guard against out-of-bounds for extra_vars_dims#1550
ra3xdh merged 2 commits into
ra3xdh:currentfrom
tskaar:dev/ts/fix-issue-1526

Conversation

@tskaar
Copy link
Copy Markdown
Contributor

@tskaar tskaar commented Dec 19, 2025

What

This PR addresses an out-of-bounds issue originally reported in #1526, where one would crash if one did a parametric sweep with a fixed (scalar) variable.

The reason that it crashes is that we always prepend the indep variable to the extra_vars list, and in that TB beta is an additional extra_var. When processing indep we increment var_idx , and then when we process beta in this particular case, we try to access: extra_vars_dims(var_idx=1), however the size of extra_vars_dims is one less than extra_vars, since we only track the size of beta, causing an out-of-bounds error. Since there was an explicit guard for !extra_vars_dims.empty(), one would not see this unless one had a TB with extra_vars.

Changes

  1. Rather than being dependent on tracking the var_idx correctly, we just use a simple name lookup to get the correct dimension.
  2. The nodes for noise simulation got addressed by changing from a fixed noise1.all to the relative all. This fixes the N-duplicate data one would get when doing a parametric sweep of N-steps.

Example

image

Testbench taken from: #1526 (comment), modified to show that it works with PtsPerSummary as well.

TODOs

Note that when using PtsPerSummary feature on noise sweep, one end up getting duplicates of the "dependent" signals, I assume that the data is the same, but it's duplicated, as seen here:

image

The fix for this can probably be done outside this PR, since this fixes a crash.

Fixes: #1526

…nversion

Use variable-specific lookups from `extra_vars_dims`
instead of a sequential index counter, preventing `var_idx`
out of bounds issues.

Previously, one could achieve out-of-bounds issues if there
was combination of `indep` and `extra_vars`.
This change uses the relative plot to save the correct
nodes. We use 'setplot noiseX' and then use the relative
wildcard save 'all' to get the equivalent of 'noiseX.all'.

Previosuly, when using the fixed value of
'noise1.all' it would end up using the first result for every plot.
Making it seems like there was one singular plot in the case of sweeps.

Fixes: 09923a8 ("plot noise contributors")
@dwarning
Copy link
Copy Markdown

Applied the patch to actual current branch will solve the issue 1526.
And I can confirm that few signals are duplicated in the result list, which is annoying but not a show stopper to merge this PR.
Thank you!

@ra3xdh ra3xdh merged commit 5d81ff6 into ra3xdh:current Dec 20, 2025
8 checks passed
@ra3xdh
Copy link
Copy Markdown
Owner

ra3xdh commented Dec 20, 2025

Thanks for fix! Merged.

@tskaar tskaar deleted the dev/ts/fix-issue-1526 branch April 20, 2026 14:37
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.

parametric noise analysis follows in crash for version 25.2

3 participants