Skip to content

Fix line break handling for fractured json formatting - #2870

Merged
lemire merged 6 commits into
simdjson:masterfrom
maxbachmann:master
Sep 21, 2026
Merged

lemire merged 6 commits into
simdjson:masterfrom
maxbachmann:master

Conversation

@maxbachmann

Copy link
Copy Markdown
Contributor

This brings formatting a lot closer to https://github.com/j-brooke/FracturedJson/wiki by fixing a bunch of issues with the handling of the line break calculation.

Type of change

  • Bug fix
  • Optimization
  • New feature
  • Refactor / cleanup
  • Documentation / tests
  • Other (please describe):

There is another big topic this doesn't touch yet which is table formatting. This has severe issues but I wasn't sure whether we essentially want to handle them close to the original Fractured Json:

  • it doesn't use line lengths to decide whether it should use table formatting
  • it reorders the elements in an alphabetic way for the matching keys. This happens even when the keys already have a consistent ordering. The original orders by first occurrence. When a key doesn't exist in a line it adds spacing in between to skip the position.
  • it has no separate complexity threshold similar to the other parts (It has a similarity threshold the original doesn't have though)

For me this handling in the original FracturedJson works quite well, but I wanted to make sure this is what we want here before making the change since it's a slightly larger change.

@maxbachmann

Copy link
Copy Markdown
Contributor Author

Also I wasn't sure if every commit should update the amalgation via the script or when this is done

@lemire

lemire commented Sep 21, 2026

Copy link
Copy Markdown
Member

Also I wasn't sure if every commit should update the amalgation via the script or when this is done

No. We refresh on release or periodically, but not on every commit.

@lemire

lemire commented Sep 21, 2026

Copy link
Copy Markdown
Member

Running tests.

@lemire
lemire merged commit dfbcc56 into simdjson:master Sep 21, 2026
114 of 115 checks passed
lemire added a commit that referenced this pull request Sep 22, 2026
…-Wmaybe-uninitialized

GCC 11.4 (Ubuntu 22.04 CI, Debug/-Og developer build with -Werror) reports a
false-positive 'v may be used uninitialized' on the json_sequence subtest
since #2870 landed on top of #2872. The variable is only read after
get(v) returned SUCCESS, so this is purely a diagnostic issue; the warning
flips on unrelated call-graph changes in headers pulled in via simdjson.h.
Initialize all the int64_t v locals in the file so the other identical
sites cannot start failing the same way later.
lemire added a commit that referenced this pull request Sep 22, 2026
…-Wmaybe-uninitialized (#2875)

GCC 11.4 (Ubuntu 22.04 CI, Debug/-Og developer build with -Werror) reports a
false-positive 'v may be used uninitialized' on the json_sequence subtest
since #2870 landed on top of #2872. The variable is only read after
get(v) returned SUCCESS, so this is purely a diagnostic issue; the warning
flips on unrelated call-graph changes in headers pulled in via simdjson.h.
Initialize all the int64_t v locals in the file so the other identical
sites cannot start failing the same way later.
@maxbachmann

Copy link
Copy Markdown
Contributor Author

@lemire what about table formatting? Is the goal to behave similar to Fractured JSON or what is the goal?

@lemire

lemire commented Sep 22, 2026

Copy link
Copy Markdown
Member

@maxbachmann Yes, we should be Fractured JSON compliant ? Whatever this might mean?

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.

2 participants