Skip to content

fix: make stage4 files sort-private, enable sub-buffer stage4 sorts - #911

Open
jodavies wants to merge 2 commits into
form-dev:masterfrom
jodavies:sub-buffer-stagesort
Open

jodavies wants to merge 2 commits into
form-dev:masterfrom
jodavies:sub-buffer-stagesort

Conversation

@jodavies

Copy link
Copy Markdown
Collaborator

For a long time, Stage4 sorting in the sub-buffers (function arguments, dollar variables, term environments) has been forbidden due to crashes.

Resolve this by moving the Stage4 file handles into the sorting struct; every sort has its own files.

File-to-file based sorting on a per-term basis will be horrible for performance so print a Warning for the user. But FORM will not simply terminate during a potentially long-running program, when the going gets tough.

This resolves #211 and #215

The fix is basically the same deal as the "nearly stage 4" problem I fixed in f09853d

For a long time, Stage4 sorting in the sub-buffers (function arguments, dollar
variables, term environments) has been forbidden due to crashes.

Resolve this by moving the Stage4 file handles into the sorting struct; every
sort has its own files.

File-to-file based sorting on a per-term basis will be horrible for performance
so print a Warning for the user. But FORM will not simply terminate during a
potentially long-running program, when the going gets tough.
@jodavies

Copy link
Copy Markdown
Collaborator Author

While preparing slides for the last workshop, I also noticed that only one of the stage4 files is ever used. The stagesort ping-pong is between one stage4 file, and the main sort file. So also remove the unused file handle.

@coveralls

coveralls commented Sep 15, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 65.932% (-0.04%) from 65.972% — jodavies:sub-buffer-stagesort into form-dev:master

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.

Unexpected code in ReNumber

2 participants