Skip to content

sort: fix sort ordering check and multi-file merge on wasi - #13688

Merged
sylvestre merged 1 commit into
uutils:mainfrom
eduardomourar:wasi-sort-fixes
Nov 12, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
eduardomourar:wasi-sort-fixes

Conversation

@eduardomourar

@eduardomourar eduardomourar commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

sort -c does not work on WASI. The check uses a background reader thread, and WASI has no threads.

Multi-file input also fails on WASI. The external sort concatenates the files without a separator, so the last line of one file joins the first line of the next.

  • Run the ordering check on the current thread on WASI. The other platforms keep the threaded reader.
  • Insert a separator between files when the previous file does not end with one.
  • Ignore the sort tests that the WASI runner cannot run.
  • Run test_sort::sort_multiple and test_sort::test_check in the WASI CI job.

@codspeed

codspeed Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

1 warning, 1 note

⚠️ 29 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

ℹ️ 1 benchmark has no flamegraph

The flamegraph wasn't generated: most of the time was spent in runtime internals, which would leave nothing useful to analyze.

See affected benchmarks

✅ 58 untouched benchmarks
⏩ 418 skipped benchmarks1


Comparing eduardomourar:wasi-sort-fixes (2c8ea97) with main (630890c)2

Open in CodSpeed

Footnotes

  1. 418 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (157b45b) during the generation of this report, so 630890c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@github-actions

github-actions Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/misc/usage_vs_getopt (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/pr/options is no longer failing!

@eduardomourar

Copy link
Copy Markdown
Contributor Author

Priority given to #13806. I have put this one to draft and will close it as soon as the necessary changes have been merged to main.

@eduardomourar
eduardomourar marked this pull request as draft August 11, 2026 11:57
@sylvestre

Copy link
Copy Markdown
Contributor

@eduardomourar thanks for this great behavior ! :)

@eduardomourar
eduardomourar force-pushed the wasi-sort-fixes branch 2 times, most recently from 84c57eb to 5488558 Compare November 1, 2026 01:30
@eduardomourar eduardomourar changed the title fix(wasi): sort ordering check and external-merge separator sort: fix sort ordering check and multi-file merge on wasi Nov 1, 2026
@eduardomourar
eduardomourar marked this pull request as ready for review November 1, 2026 01:33
@eduardomourar

Copy link
Copy Markdown
Contributor Author

I have to mark this PR back as ready because it is still required.

@eduardomourar
eduardomourar force-pushed the wasi-sort-fixes branch 2 times, most recently from bb8a945 to 001176e Compare November 5, 2026 12:34
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

Binary size comparison:

Individual binary size comparison VS main (threshold: >=5% AND >=4 KB).

Total size of compared binaries: 155.30 MB (+60 KB, +0.04%)

Significant per-binary changes:
  printenv     1.09 MB ->    1.15 MB  (+60 KB, +5.36%)

Comment thread .github/workflows/wasi.yml Resolved
Comment thread src/uu/sort/src/check.rs Resolved
Comment thread src/uu/sort/src/check.rs Resolved
Comment thread tests/by-util/test_sort.rs Resolved
Comment thread tests/by-util/test_sort.rs Resolved
Comment thread tests/by-util/test_sort.rs Resolved
Comment thread tests/by-util/test_sort.rs Resolved
@sylvestre
sylvestre merged commit d8966c1 into uutils:main Nov 12, 2026
118 of 119 checks passed
@eduardomourar
eduardomourar deleted the wasi-sort-fixes branch November 15, 2026 18:42
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