Skip to content

Replace mutable list usages with TreeList in stack operations#1033

Open
s5bug wants to merge 8 commits into
FallingColors:1.21from
s5bug:vector-fixes-4
Open

Replace mutable list usages with TreeList in stack operations#1033
s5bug wants to merge 8 commits into
FallingColors:1.21from
s5bug:vector-fixes-4

Conversation

@s5bug

@s5bug s5bug commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Stacked on #1032

TODO is make a pass through all the list ops and make sure they're not doing O(n) copies but I'm not going to waste my time with that in case I have to go back and modify other stuff

@github-project-automation github-project-automation Bot moved this to 📋 Backlog in Hex Casting Apr 28, 2026
@s5bug s5bug force-pushed the vector-fixes-4 branch 2 times, most recently from 9ae3fb8 to 2ddfb0a Compare May 10, 2026 19:09
@s5bug s5bug changed the base branch from main to 1.21 June 7, 2026 20:32
@s5bug s5bug force-pushed the vector-fixes-4 branch 5 times, most recently from 24b4424 to b7864a8 Compare June 12, 2026 02:00
@s5bug s5bug marked this pull request as ready for review July 16, 2026 00:11

@Robotgiggle Robotgiggle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested exhaustively but nothing seems to be broken. Simulate still works fine, as does the Shepherd Directrix.

Comment thread CHANGELOG.md Outdated

- Removed APIs deprecated in `0.11.4` ([#1126](https://github.com/FallingColors/HexMod/pull/1126), [#1127](https://github.com/FallingColors/HexMod/pull/1127) [#1129](https://github.com/FallingColors/HexMod/pull/1129), [#1137](https://github.com/FallingColors/HexMod/pull/1137), [#1142](https://github.com/FallingColors/HexMod/pull/1142)) @s5bug
- ListIota now uses the asymptotically-efficient TreeList internally ([#1032](https://github.com/FallingColors/HexMod/pull/1032)) @s5bug
- SpellList has been removed, the Casting Image and Casting Frames now store iotas in a TreeList ([#1033](https://github.com/FallingColors/HexMod/pull/1033)) @s5bug

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SpellList was removed in #1032, not here


val image2 = image.withUsedOp().copy(stack = stack)
// FIXME this is expensive if the stack is incredibly large
// someone should rewrite this op to cut and replace a `slice` of the `TreeList` stack

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I have an implementation for this - can I push it to this PR or do you want it in a separate PR after this goes in?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go nuts 👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it's been pushed. Let me know if you think I did anything wrong.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any advantage to having newOrder be a TreeList? Or would it be better to have it also be a standard MutableList?

@s5bug

s5bug commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

New Swindler's looks good, I just replaced the x = x.addOne with x being a builder instead since the collection isn't used for anything else

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋 Backlog

Development

Successfully merging this pull request may close these issues.

2 participants