Skip to content

Conversation

@TerrorJack
Copy link
Contributor

  • simdutf: update to 8.0.0 and use upstream c api
  • ci: add simdutf-is-genuine ci job to check if vendored simdutf is genuine

@TerrorJack TerrorJack force-pushed the wip/simdutf_8_0_0 branch 2 times, most recently from d67eccf to 88b644d Compare January 15, 2026 03:00
@Bodigrim
Copy link
Contributor

Waiting for nomeata/inspection-testing#97...

There seems to be a genuine build failure at https://github.com/haskell/text/actions/runs/21018119841/job/60427258761?pr=685#step:3:705:

   cbits/hs_simdutf.c:1:10: error:
       fatal error: simdutf_c.h: No such file or directory
          1 | #include "simdutf_c.h"
            |          ^~~~~~~~~~~~~
    |
  1 | #include "simdutf_c.h"
    |          ^

@TerrorJack
Copy link
Contributor Author

i'm confused...the build works locally and in haskell-ci jobs, and the haskell-ci jobs have simdutf flag enabled by default right? i don't understand why there's a header not found error.

it can easily be worked around by just pasting the prototype and avoiding including simdutf_c.h, but maybe it's something more cursed going on here.

@Bodigrim
Copy link
Contributor

Emulated CI jobs are cursed indeed, I suppose one needs to adjust the incantation to pass GHC with all necessary files there.

@Lysxia
Copy link
Contributor

Lysxia commented Jan 17, 2026

It seems that the emulated jobs don't use simdutf. It builds using ghc --make, ignoring the cabal file. There is an argument cbits/*.c so it also tries to build the new hs_simdutf.c wrapper.

A simple fix may be to put hs_simdutf.c into a subdirectory.

@TerrorJack
Copy link
Contributor Author

nice catch! i've moved hs_simdutf.c to simdutf to avoid it being built by non-simdutf mode.

@Lysxia
Copy link
Contributor

Lysxia commented Jan 17, 2026

I'm looking into the inspection-testing failure.

@Bodigrim
Copy link
Contributor

@TerrorJack rebase again please.

import GHC.Exts (Ptr,ByteArray#)

foreign import ccall unsafe "_hs_text_is_valid_utf8" c_is_valid_utf8_ptr_unsafe
foreign import ccall unsafe "simdutf_validate_utf8" c_is_valid_utf8_ptr_unsafe
Copy link
Contributor

Choose a reason for hiding this comment

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

These entities are visible to users. Could we avoid changing their types (by introducing a wrapper, perhaps)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the module names have Internal for a good purpose! but i don't have a strong opinion either, so i've avoided changing these in the patch.

This patch updates vendored simdutf to 8.0.0:
https://github.com/simdutf/simdutf/releases/tag/v8.0.0, and makes use
of simdutf's own C API.
This commit adds a simdutf-is-genuine CI job to check if vendored
simdutf is identical to the files in the singleheader.zip upstream
release archive.
@Bodigrim Bodigrim requested a review from Lysxia January 17, 2026 17:29
@Lysxia Lysxia merged commit f6a35e5 into haskell:master Jan 17, 2026
27 checks passed
@TerrorJack TerrorJack deleted the wip/simdutf_8_0_0 branch January 18, 2026 05:56
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.

3 participants