Skip to content

ci/spec22-gems: incident 13 round-8 — FFI raw LoadLibraryEx matrix + library_aliases manifest - #93

Merged
ronaldtse merged 2 commits into
mainfrom
ci/spec22-sassc-bisect-r8
Aug 19, 2026
Merged

ci/spec22-gems: incident 13 round-8 — FFI raw LoadLibraryEx matrix + library_aliases manifest#93
ronaldtse merged 2 commits into
mainfrom
ci/spec22-sassc-bisect-r8

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Incident 13, round 8 — mechanism matrix + the alias fix experiment

Round 7 (run 32211646613) narrowed the sassc-on-tebako-windows failure to one
mechanism: ffi 1.17.4's win32 dl_open calls
LoadLibraryExA(name, NULL, LOAD_WITH_ALTERED_SEARCH_PATH) on the full VFS
path. The covered route resolves the main module (every solo-load green, every
byte sha256-verified) but the dependency search of that call fails at
require time — error 126 on lib/sassc/libsass.so. The sibling runtime DLLs
(libwinpthread-1.dll, libgcc_s_seh-1.dll) live co-dir in the image and
materialize fine.

This round changes the probe in two directions at once:

1. sassc-matrix — the raw mechanism record

The fiddle flag matrix died with ruby 4.0 (fiddle left the default gems;
LoadError is ScriptError, not StandardError). It is replaced by
sassc_raw_matrix: kernel32 LoadLibraryExA / FreeLibrary / GetLastError
bound through FFI itself, run against:

  • lib/sassc/libsass.so — vfs spelling vs host spelling × flags
    0x0 / 0x8 (ALTERED) / 0x1100 (ALTERED|LIMITED)
  • the sibling runtime DLLs — vfs vs host × 0x8

Each successful handle is freed. This is the diagnostic that decides the fix
surface if the alias route fails: vfs:altered failing means the covered
route cannot serve the main module at all (driver surface change); succeeding
while sibling raw-loads fail means the search order is still broken.

2. library_aliases: — the designed fix, exercised end to end

run-msys.sh now stamps library_aliases: into BOTH probe manifests at press
time (the sassc gem's *.dll closure, deduped by name) and greps that the
stamp landed. This rides tebako v0.1.9 (ccecb275): the driver's alias.rs
boot-materializes declared aliases and PREPENDS their dirs to the process
PATH — the raw-surface answer, interception-free by design. Aliases are
orthogonal to the materialize: negative oracle, which stays.

Acceptance (unchanged)

proof-sassc.log must carry PROBE gem-loaded no + PROBE sassc-main ok +
PROBE sassc-partial ok + the unmaterialized leg's pinned expected-fail +
SPEC22-GEMS-MSYS-ACCEPTANCE-OK. proof-sassc-matrix.log is the mechanism
record.

Also fixed: sassc_ffi_load_legs reordered (libsass first, siblings,
libsass:again), LoadError rescued alongside StandardError, the
nonexistent FFI::DynamicLibrary#free call dropped, and module paths resolve
via Gem::Specification.find_by_name.

Local gates: rspec 110/110, ruby -c / bash -n clean.

Draft — do not merge. The harness runs UNMERGED via the factory's new
harness_ref dispatch input; merging is a C3 close-out decision, not a
prerequisite for the probe.

…ses manifest (incident 13)

Round 7 pinned the failure to ffi's win32 dl_open: LoadLibraryExA with
LOAD_WITH_ALTERED_SEARCH_PATH on the covered VFS path resolves the main
module but not its dependency search at require time (error 126 on
lib/sassc/libsass.so with every byte verified and every solo-load green).

probe.rb:
- The fiddle flag matrix dies with ruby 4.0 (fiddle left the default
  gems; LoadError is ScriptError) and is replaced by sassc_raw_matrix —
  kernel32 LoadLibraryExA/FreeLibrary/GetLastError bound through FFI
  itself: libsass.so vfs/host x flags 0x0/0x8/0x1100 plus the sibling
  runtimes, each freed after success.
- sassc_ffi_load_legs reordered (libsass first, siblings, libsass:again),
  LoadError rescued alongside StandardError, the nonexistent
  FFI::DynamicLibrary#free call dropped.
- New ARGV mode 'sassc-matrix' (windows-gated; posix prints skip).

run-msys.sh:
- stamp_library_aliases() finds the sassc gem's *.dll closure at press
  time and appends library_aliases: entries to BOTH probe manifests
  (aliases are orthogonal to the materialize: negative oracle), with
  post-press greps asserting the stamp landed.
- Fifth dogfood leg 'sassc-matrix' with st_matrix gating; the canary
  cross-check counts it.

Rides tebako v0.1.9 (ccecb275): the driver's alias.rs boot-materializes
declared aliases and PREPENDS their dirs to the process PATH — the
raw-surface answer, interception-free by design. rspec 110/110 green;
ruby -c / bash -n clean.
…elling (incident 13)

Round 8's verdict: the library_aliases fix WORKS — require sassc +
sassc-main green on the alias-materialized PATH; the unmaterialized
oracle red exactly as pinned; sinatra 200 x2. The one red leg,
sassc-partial, is a probe bug: TEBAKO_EXEC_CACHE arrives in the host
spelling (backslashes) and Dir.glob treats backslash as an escape on
windows, so the materialization check globbed a degenerate pattern and
reported hits=0 while the driver log shows the styles tree materialized
fine (resources/4afd6aab980ce2ab/probe/styles). The same trap kept the
raw matrix's host legs 'skipped (no spelling)'.

Both Dir.glob sites now normalize with tr('\\', '/') — a no-op on
posix, where this leg was already green. rspec 110/110.
@ronaldtse
ronaldtse marked this pull request as ready for review August 19, 2026 08:17
@ronaldtse
ronaldtse merged commit 4660979 into main Aug 19, 2026
42 checks passed
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