runLengthEncode rewrite - #4532
Open
pzinn wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
there are two failing examples:
edited: all good now, first example corrected, and fixed code so second example unchanged |
pzinn
force-pushed
the
rle
branch
5 times, most recently
from
August 5, 2026 05:00
ce5363a to
6262016
Compare
Member
|
The following WeylAlgebras test is failing: i14 :
-- Dbasics basics
R = QQ[r,s];
i15 : A = makeWeylAlgebra R;
i16 : B = QQ[r,s,dr,ds,WeylAlgebra => {r=>dr,s=>ds}];
i17 : assert (describe A===describe B);
stdio:22:8:(3):[1]: error: assertion failedThey look the same, but from what I can tell, the i5 : describe A
o5 = QQ[r, s, dr, ds, Degrees => {4:1}, Heft => {1}, WeylAlgebra => {{r, dr}, {s, ds}}]
i6 : describe B
o6 = QQ[r, s, dr, ds, Degrees => {4:1}, Heft => {1}, WeylAlgebra => {{r, dr}, {s, ds}}]
i7 : rA = (describe A)#0#1#6#2#0#0#0#0
o7 = r
o7 : monoid[r, s, dr, ds, Degrees => {4:1}, Heft => {1}, WeylAlgebra => {{r, dr}, {s, ds}}]
i8 : rB = (describe B)#0#1#6#2#0#0#0#0
o8 = r
o8 : monoid[r, s, dr, ds, Degrees => {4:1}, Heft => {1}, WeylAlgebra => {{r, dr}, {s, ds}}]
i9 : rA === rB
o9 = false
i10 : hash class rA
o10 = 1044676
i11 : hash class rB
o11 = 1044700 |
Contributor
Author
|
yeah that's a weird one. will investigate |
Contributor
Author
|
edited: figured it out. the modification of |
seangrate
approved these changes
Aug 24, 2026
seangrate
left a comment
Member
There was a problem hiding this comment.
The added tests are appreciated!
d-torrance
added a commit
to d-torrance/M2
that referenced
this pull request
Aug 25, 2026
… nobody had seen Ten rows, Macaulay2#4339 to Macaulay2#4398. Applied on his "I approve. Please commit/apply/push". Two comments out, nothing closed. Eight of the ten reproduce, the highest rate of any batch so far. Macaulay2#4339 reproduces ISC is dead at the DNS level, not just the path Macaulay2#4342 stands the AI analysis missed a site, and that site is dead code Macaulay2#4356 reproduces COMMENTED -- pasted input puts the whole block in history 1 Macaulay2#4368 reproduces check(41) fails here too; Bertini is installed Macaulay2#4376 reproduces COMMENTED -- a three-line case with no garbage at all Macaulay2#4389 reproduces path keeps its relative entries across the cd Macaulay2#4391 reproduces 3.227s, 3.184s, 3.143s -- no caching whatsoever Macaulay2#4392 reproduces closing stdio makes every later prompt fail, forever Macaulay2#4393 reproduces fixed in pzinn's Macaulay2#4532, still open Macaulay2#4398 stands the primitive he wants already exists as sethash Published: comments on Macaulay2#4356 and Macaulay2#4376; types on all ten; labels +package issue on Macaulay2#4339 and Macaulay2#4391, +Interfaces on Macaulay2#4368, +Core on Macaulay2#4389 and Macaulay2#4393, +Interpreter on Macaulay2#4392; and -bug on Macaulay2#4356, Macaulay2#4368 and Macaulay2#4376. THE bug LABEL IS NOW A STANDING SWAP. Doug's instruction this batch: "Everything `bug` label should be replaced with the `Bug` type. Same with `feature request` => `Feature`." So a row carrying either label is triaged as one move, --type Bug --rm bug, and the removal rides along in the batch approval rather than being asked about on its own. Recorded in README.md under "Types, not the bug and feature request labels", with the counts that show no back-fill is needed: when the instruction was given only 2 already-triaged rows still carried `bug` -- Macaulay2#4356 and Macaulay2#4368, both here -- against 78 untriaged. 77 remain, all of them todo. Macaulay2#4376 is the row that grew. pzinn's frac(QQ[x])[y] case still produces a 603662 character entry and Doug's zero-denominator QQ, but there is a smaller one with no frac and nothing alarming in the output: in S = QQ[x][y], mutableMatrix{{x}} * mutableMatrix{{y}} is x^2 where the immutable product is x*y. ring a_(0,0) is QQ[x] and ring b_(0,0) is S, so nothing promotes to a common ring and the product reads one variable as the other. That is the version worth fixing against: three lines, silently wrong, no 600KB of digits to raise the alarm. Macaulay2#4356's mechanism is history indexing rather than positions. locate is right throughout; what fails is that pasted input lands entirely in history entry 1 with the following entries empty, so code's stdio branch stacks "" for anything defined after the first line of a block and the guard at m2/code.m2:76 fires with 0 < 1. That is the pattern pzinn could not see -- any line after the first in a block, which on Macaulay2Web is most of them. Macaulay2#4351 gave `return` a position and so triggered a lookup that used to be skipped; the history gap is older. Macaulay2#4391 needed the reporter's own input. A small ideal is a bad proxy -- ZZ/101[a..f] with four random cubics went 0.168s then 0.029s, which reads either way -- so his 5.5KB ideal came out of the issue body with gh rather than being retyped, and three successive minimalBetti calls took 3.2273s, 3.18395s, 3.14285s. Also answered his side question: minimalBetti over QQ does not error. Two things Doug caught. Macaulay2#4393's follow-up comment was drafted and then dropped: pzinn's PR Macaulay2#4532 merges rle and runLengthEncode, so explaining the difference between them would explain a distinction he has already deleted -- and that PR fixes both halves of the row. And Macaulay2#4347 was reported here as unmerged on the strength of `gh api ... -q '.mergedAt'` returning null, which is the GraphQL spelling of a REST field; it merged 2026-06-06. That trap is now written up in README.md under "Finding the commit". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this is a complete rewrite of the code in
runLengthEncode.I've also taken the opportunity to merge
rleandrunLengthEncode.The behaviour should be mostly unchanged, except for a few extra
Holders here and there for consistency and to fix obscure cases of the documentedvaluebehaviour.And it fixes #4393. Repeated entries are encoded before consecutive entries. A range is encoded only when it has three entries or more. Tests added.
(There was already one related test in
normal/formatting.m2but I decided to leave it there and create a new test file.)