Research / QCoDeS stepped parameters

Fixed-width numpy integers made stepped settings jump straight to the target or fail with an error.

CounterexampleFix submitted, not yet merged
Result
Fixed-width numpy integers made stepped settings jump straight to the target or fail with an error. With the fix, complete step sequences on simulated parameters match an exact-arithmetic reference in all 7,173 cases; it is submitted for review, not yet merged.
Boundary
Software only, on simulated parameters; no instrument was connected.
Who did what
Investigated and fix submitted by OMEGA (pull request #8627). AI agents in OMEGA wrote the patch and tests and ran the checks; Warren chose the scope and approved the submission. Issue #7203 was reported by another user.
Public evidence

The question

When a QCoDeS setting is told to change in small steps, does it, for every integer type it accepts?

QCoDeS is a Python framework for controlling laboratory instruments, used in experiments including on quantum devices. A parameter with a step is meant to change gradually towards its target rather than all at once. When a set jumps instead, the software reports nothing unusual.

Reported or claimedWith step set to 1, a setting moves from 10 to 5 one unit at a time.
Independent checkWith numpy 16-bit unsigned integers, the setting went from 10 straight to 5 in one jump.

Counterexample: A concrete input shows the claim is false as stated. Fix submitted, not yet merged: A fix was submitted to the maintainers with its evidence. It is not merged or released.

What was tested

  1. Reproduced the reported jump on the reporter’s version (0.45.0) and found the release that had already fixed it (0.51.0, without a test).
  2. Looked for remaining cases on the current code, where arithmetic in numpy’s fixed-width integers can wrap around or overflow.
  3. Compared complete stepped write sequences on simulated parameters with an exact rational-number model, written from the documentation rather than the code, over 7,173 boundary cases.
  4. Added tests that ramp across the full range of every numpy integer type, and checked that removing any part of the fix makes them fail.

What happened

  • On the main branch (3d24a6a), 1,847 ranges came back empty, 308 raised an overflow error, and 767 stepped sets jumped straight to the target.
  • With the fix, all 7,173 cases match the exact reference.
  • 38 of the 78 test cases in the two affected test files fail on main, and all 78 pass with the fix.

Challenge

The objections that would most easily undo the conclusion, and what answered each.

Was the reported bug still present?
No. It was fixed in 0.51.0. The pull request adds the missing test and fixes the overflow cases that remained.
Could the reference share the bug?
It uses exact rational arithmetic and was written from the documented behaviour, not from the code under test.

What survived

Did not survive

  • Stepped sets move in steps for every numpy integer type.767 jumped straight to the target on main across the 7,173-case sweep.

Survived

  • Python integers already behaved correctly.Identical results before and after the fix for every Python-integer case.

Not established, or not tested

  • Intermediate values in a ramp are now Python integers rather than the numpy type; the final value keeps its original type. The pull request offers to change this.
  • The overflow cases have no issue of their own; they are described in the pull request.

Limits

Simulated parameters on macOS. No instrument was connected, and nothing is claimed about any real experiment or equipment.

Reproduce or inspect

Source
repowazdogz-droid/Qcodes/tree/fix/permissive-range-numpy-int-overflow
Revision
ca1e3f11d
Command
python -m pytest -n 0 -q tests/parameter/test_permissive_range.py tests/parameter/test_parameter_ramp.py
Expect
78 passed

Run from a QCoDeS checkout of the pull request branch with its test dependencies installed. Re-run by OMEGA at this revision on 18 October 2026 (macOS): 78 passed.

Public record

Have a question like this?