Skip to content

uucore: for fs use real inode dev stat on wasi - #13684

Open
eduardomourar wants to merge 1 commit into
uutils:mainfrom
eduardomourar:wasi-fs-inode-dev-stat
Open

eduardomourar wants to merge 1 commit into
uutils:mainfrom
eduardomourar:wasi-fs-inode-dev-stat

Conversation

@eduardomourar

Copy link
Copy Markdown
Contributor

FileInformation previously fell back to a std::fs::Metadata-based heuristic (comparing file type and size) on WASI, since it lacked access to nix::sys::stat. Switch it to rustix::fs::Stat, the same backing type used on Unix, giving WASI real inode/device identity, nlink, and equality checks instead of an approximation. Also add WASI implementations of are_hardlinks_to_same_file and are_hardlinks_or_one_way_symlink_to_same_file via rustix::fs::stat/ lstat, since std::os::unix::fs::MetadataExt is unavailable there.

@codspeed

codspeed Bot commented Aug 1, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 2 benchmarks

⚡ 17 improved benchmarks
❌ 2 regressed benchmarks
✅ 380 untouched benchmarks
⏩ 54 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation sort_dictionary_order[500000] 1.9 s 2.1 s -6.54%
❌ Simulation rm_recursive_tree 13.7 ms 14.4 ms -5.02%
⚡ Simulation three_39_bit_primes 545.9 ms 405.7 ms +34.56%
⚡ Simulation cut_fields_custom_delim 65.9 ms 51.9 ms +27%
⚡ Simulation cut_fields_tab 57.4 ms 45.5 ms +26.24%
⚡ Simulation cut_bytes 18.1 ms 15.5 ms +16.69%
⚡ Simulation check_sorted_utf8_locale 491.1 ms 422.9 ms +16.13%
⚡ Simulation five_38_bit_primes 1.7 s 1.5 s +15.04%
⚡ Simulation sort_numeric_utf8_locale 40.8 ms 36.1 ms +12.99%
⚡ Simulation merge_single_file_utf8_locale 133.4 ms 119.3 ms +11.84%
⚡ Simulation cut_characters 25.4 ms 22.9 ms +10.88%
⚡ Simulation merge_pre_sorted_files_utf8_locale 251.9 ms 238.1 ms +5.77%
⚡ Simulation merge_pre_sorted_files 252.5 ms 238.8 ms +5.72%
⚡ Simulation sort_german_de_locale 295 ms 282.1 ms +4.6%
⚡ Simulation sort_case_sensitive[500000] 334.9 ms 321 ms +4.32%
⚡ Simulation sort_spill_to_tmp_files_utf8_locale 332.1 ms 321 ms +3.44%
⚡ Simulation sort_reverse_utf8_locale 81.9 ms 79.2 ms +3.43%
⚡ Simulation sort_mixed_utf8_locale 82.1 ms 79.4 ms +3.4%
⚡ Simulation sort_unique_utf8_locale 84.9 ms 82.2 ms +3.34%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing eduardomourar:wasi-fs-inode-dev-stat (be1501f) with main (8f6a838)

Open in CodSpeed

Footnotes

  1. 54 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. ↩

@github-actions

github-actions Bot commented Aug 1, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/date/resolution (fails in this run but passes in the 'main' branch)

@eduardomourar
eduardomourar force-pushed the wasi-fs-inode-dev-stat branch from 7425df9 to ab6642b Compare August 1, 2026 12:43
@eduardomourar
eduardomourar force-pushed the wasi-fs-inode-dev-stat branch 2 times, most recently from 3d8f91e to 2d8d677 Compare August 11, 2026 20:09
@eduardomourar
eduardomourar force-pushed the wasi-fs-inode-dev-stat branch 4 times, most recently from d880271 to d5437e3 Compare September 8, 2026 13:35
@eduardomourar

Copy link
Copy Markdown
Contributor Author

@sylvestre, this one is ready (now with proper testing in place).

@eduardomourar
eduardomourar force-pushed the wasi-fs-inode-dev-stat branch 2 times, most recently from 2dcd55b to 106a29b Compare September 15, 2026 08:14
Comment thread src/uucore/src/lib/features/fs.rs Outdated
Comment thread src/uucore/src/lib/features/fs.rs Outdated
Comment thread src/uucore/src/lib/features/fs.rs
Comment thread tests/by-util/test_comm.rs Outdated
@eduardomourar
eduardomourar force-pushed the wasi-fs-inode-dev-stat branch 2 times, most recently from 16bc926 to d7de947 Compare September 28, 2026 21:58
@sylvestre

Copy link
Copy Markdown
Contributor

Thanks, this looks much better: there's one rustix impl shared by unix and wasi now, the target-first early return is still there, and the tests run on wasi too. One nit left: the comment in fsext/mod.rs:142 can just be // ctime isn't exposed by std Metadata outside unix. Also, does any CI job actually run the uucore tests on wasi? If not, the new wasi cfgs are still untested.

@eduardomourar
eduardomourar force-pushed the wasi-fs-inode-dev-stat branch from d7de947 to d0fad40 Compare October 6, 2026 21:53
@eduardomourar

Copy link
Copy Markdown
Contributor Author

Done. Added a step to wasi.yml in order to run the unit tests for uucore.

@sylvestre
sylvestre force-pushed the wasi-fs-inode-dev-stat branch from d0fad40 to a7880bd Compare October 8, 2026 13:38
@eduardomourar
eduardomourar force-pushed the wasi-fs-inode-dev-stat branch from a7880bd to be1501f Compare October 8, 2026 19:39

This branch has not been deployed

No deployments
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