Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 14 sort, SMB3 shuffle, & bugfixes galore #101

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

warmCabin
Copy link

@warmCabin warmCabin commented Nov 18, 2023

Sup? Been having some fun with this project lately. I'd be happy to split these out into multiple branches if you want to cherry pick.

New features:

Bug Fixes:

  • Highlights: Fix bounds checking in markArray and throw early.
    • Previously, it would accept indices over 32767 with no immediate problems and cause pernicious crashes down the line in clearAllMarks.
    • I've included a little test sort that intentionally causes the crash.
  • JEnhancedOptionPane: "Use default" no longer accepts your input.
  • ArrayManager: Improve error handling for custom distributions.
    • If the file is nonexistent, malformed, or the user just clicks cancel, the selection is rejected and the previous one remains.
  • ShufflePrompt, ShuffleDialog: Fix double update bugs in JList handlers
    • I'm not actually sure what tool was used to generate these files, but I don't think I stepped outside the proper bounds, here.
  • Perlin noise: Fix floating point error that lead the shuffler to sample a constant point
    • I just used Math.nextUp, which is basically just *(float*)(*((int*)&randomStart) + 1). The real fix is to use doubles.

I grabbed DualPivotQuickSort by ctrl+clicking into Arrays.sort. Turns out I had
my IDE settings pointing to Java 14 for this project, even though maven was set
to use Java 11. Why is IntelliJ like this?
I'm going to make markArray throw these early.
UNINITIALIZED_VALUE means the textbox was empty. This method never actually
checked which button was clicked.
Didn't realize I was working around generated code here at first!
Forgot I had been messing around with Reads.java.
If the starting offset is too high, 1/arrayLength will be less than the
minimum float delta at that point. When that happens, we get 9001 copies of the
same brown noise output. By using Math.nextUp, we'll get spikier slopes in this
case instead of an empty box.
The idea here is to normalize the minimum to 0. Now it works whether that
minimum is positive or negative.
Please let me know if I'm full of crap on these
I searched the project for href and found this interesting design decision
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