Skip to content

Base: give jl_string_ptr its effects - #63465

Draft
vchuravy wants to merge 1 commit into
vc/effects-3-effects-attrsfrom
vc/effects-4-string-ptr-effects
Draft

vchuravy wants to merge 1 commit into
vc/effects-3-effects-attrsfrom
vc/effects-4-string-ptr-effects

Conversation

@vchuravy

@vchuravy vchuravy commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Fourth of a 4-PR stack (#63462 → #63463 → #63464 → #63465). Independent of the others in content — it only sits on top so PkgEval on this PR covers the whole stack — and can be rebased onto master and merged on its own.

unsafe_convert(::Type{Ptr{UInt8}}, ::String) is a plain foreigncall and therefore EFFECTS_UNKNOWN, which makes every String primitive built on pointer(s) (codeunit, isascii, nextind, …) lose :nothrow, :notaskstate and :inaccessiblememonly even though GC.@preserve itself is effect-transparent. jl_string_ptr is pure pointer arithmetic on the object; it is not :consistent because egal strings have distinct addresses.

Adds a bootstrap @_total_notconsistent_meta (like @_total_meta, minus :consistent) since @assume_effects is not available yet in essentials.jl.

Before/after:

pointer(::String)   (!c,!e,!n,!t,!s,!m,…)  →  (!c,+e,+n,+t,+s,+m,…)
codeunit (inbounds) (+c,+e,!n,+t,!s,!m,…)  →  (+c,+e,!n,+t,+s,!m,…)
isascii             (+c,+e,+n,+t,!s,!m,…)  →  (+c,+e,+n,+t,+s,!m,…)

(!m remains because pointerref is defined with inaccessiblememonly = ALWAYS_FALSE.)

🤖 Generated with Claude Code

@vchuravy

This comment was marked as outdated.

@vchuravy

Copy link
Copy Markdown
Member Author

@pkgeval runtests()

@vchuravy

Copy link
Copy Markdown
Member Author

@nanosoldier runbenchmarks()

@vchuravy
vchuravy force-pushed the vc/effects-4-string-ptr-effects branch from 7408486 to 57c5123 Compare September 29, 2026 12:19
@pkgeval

pkgeval commented Sep 29, 2026

Copy link
Copy Markdown

@vchuravy: run gh-5884395480 finished — possible new issues: 205 packages ❌

Full report: https://pkgeval-reports.julialang.org/?run=gh-5884395480
Estimated compute cost: $55.75 (EC2 spot)

@vchuravy
vchuravy force-pushed the vc/effects-4-string-ptr-effects branch 2 times, most recently from 7b5e657 to 086d3bf Compare October 5, 2026 05:40
`unsafe_convert(::Type{Ptr{UInt8}}, ::String)` was a plain foreigncall
and therefore EFFECTS_UNKNOWN, which made every String primitive built on
`pointer(s)` (`codeunit`, `isascii`, `nextind`, ...) lose :nothrow,
:notaskstate and :inaccessiblememonly even though `GC.@preserve` itself
is effect-transparent. `jl_string_ptr` is pure pointer arithmetic on the
object; it is not :consistent because egal strings have distinct
addresses. Adds a bootstrap `@_total_notconsistent_meta` since
`@assume_effects` is not available yet in essentials.jl.

Assisted-by: Claude Code (Fable 5.1)
@vchuravy
vchuravy force-pushed the vc/effects-4-string-ptr-effects branch from 086d3bf to ebe24d1 Compare October 5, 2026 10:27

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

compiler:effects effect analysis strings "Strings!"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants