Skip to content

Bound shift counts and validate snapshot shift commands - #2528

Open
Emma C (emmche) wants to merge 1 commit into
microsoft:mainfrom
emmche:users/emmche/bound-shifts-and-validate-snapshots
Open

Emma C (emmche) wants to merge 1 commit into
microsoft:mainfrom
emmche:users/emmche/bound-shifts-and-validate-snapshots

Conversation

@emmche

@emmche Emma C (emmche) commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Snapshot loading hangs caused by unsupported shift commands.

Description of the changes:

  • Apply both upper and lower bounds to native left/right shift counts before constructing powers of two.
  • Reject shift commands outside Programmer mode across snapshot display, expression, and history commands, before changing the current session.
  • Add regression coverage for extreme counts, supported boundaries, zero-input behavior, and preservation of display/memory when snapshots are rejected. Normal Programmer shifts and Scientific calculations remain unchanged.

How changes were validated:

  • Debug and Release x64 builds succeeded; 142 targeted automated tests passed: 105 snapshot/view-model tests, 16 Rational/CalcEngine tests, and 21 CalculatorManager tests.
  • Verified Standard arithmetic, decimals, error recovery, memory/history, Scientific powers/roots/trigonometry, and Programmer shifts/radix conversion on a Windows VM.
  • Manually confirmed that the previously hanging snapshot now displays error

Reject unsupported shift magnitudes in both directions and require Programmer mode for snapshot shift commands before restoring state. Add regression coverage for bounds and session preservation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@emmche
Emma C (emmche) marked this pull request as ready for review November 17, 2026 22:27
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.

1 participant