Complete async FFI integration and ABI regression coverage

Aperta
#102 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, cpp, rust

Direzione di ricerca

Start by reviewing PR #68 against current main, focusing on the scanner and native-test conflict areas and the existing callback and panic-guard contracts. Map each operation to its public Rust core method and validation path at the specified commit, using Rust behavior as the semantic reference. Done means resolving the conflicts, adding ABI checks for relevant public types and discriminants, validating Rust and native C/C++ entry points on NieR, and obtaining an independent review.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

PR #68 centralizes future-to-callback completion and adds C/Rust ABI layout checks. It remains useful, but its current head conflicts with main in scanner and native-test code.

Work

  • Inventory current public ABI types and prepare an isolated conflict map and focused completion-path experiment; this is not acceptance of the author branch.

  • Confirm the existing author's ownership and a concrete integration handoff before branch changes.

  • Resolve the actual conflicts while preserving current scanner features and entry-point panic guards.

  • Keep callback completion, caller/callback thread-local errors, panic conversion, poisoning, and callback-context retirement contracts intact.

  • Review the completion type and reporting boundaries against actual call paths, separating demonstrated defects from future misuse concerns.

  • Extend ABI coverage for relevant current public types and discriminant values (independent current-main regression merged in #222).

  • Validate the updated integration commit through Rust and native C/C++ entry points on NieR, then obtain an independent review.

The current assessment has not demonstrated a double callback in the existing scanner path. Old green CI on the PR does not establish compatibility with the current main.

Related PR is #68. Parent goal is #99.

Rust authority

The functional inventory uses pylance as a reference. The selected Lance Rust core at 40f15ed1b71b66950961b175829fdf17a763f108 defines available capabilities, parameter meanings, operation semantics and boundaries. C/C++ additions provide the foreign-language representation, ownership and error conversion needed to call that core.

Before implementation, map each operation to its public Rust method/type and validation path. Use direct Rust behavior as the semantic oracle. Any missing core operation is a core prerequisite. Binding-only product capabilities, policies and new query/retention semantics are outside this task. Existing public compatibility constraints must be handled explicitly during migration.

Contributor coordination (2026-11-12 UTC)

The maintainer asked the original author about further updates and offered integration help on November 12. The request preserves the author's contribution and commit history. No subsequent author reply or integration handoff is recorded at this checkpoint. Permission to send that request does not itself transfer branch ownership; no branch takeover or conflict-resolution push is being inferred from silence or maintainer-edit access.

The remaining work above is unchanged. Once the author coordinates a handoff or supplies an updated branch, assess the actual current-main conflicts and run the affected completion/ABI entry points before acceptance. Independent project maintenance continues meanwhile; this is not awaiting another authorization from the project owner.

Independent integration preparation (2026-11-12 UTC)

Preparation is anchored to main 69c2d0358194c70d1305dea81b5854cea867ef44 and PR #68 head 1bb8e605941e5c29e6c2f04fe616edb7c39f77f1. Relevant product files remain unchanged at 6d805a8; Lance 14.0.2 pin is unchanged. The author branch was not edited. Temporary validation branches are experiments, not a replacement product PR or an author handoff.

Integration invariants

The isolated merge conflicts are scanner imports/setup and the native test harness. Preserve current main's s.begin_scan() before build_scanner: the older branch relied on behavior that has since moved out of build_scanner. Retain caller/callback TLS error delivery, the scanner poison flag, entry-point panic containment, GuardedReader, stream ownership, and the current native-consumer harness signature. The isolated integration experiment passed five bridge tests, three scanner tests, three C-API async tests, the C++ consumer, Clippy, and a Release library build with Rust 1.94.0 on Linux x86_64. A preceding experimental head also passed the C11 consumer. These are focused execution records, not a full suite or cross-platform acceptance.

ABI inventory and evidence limits

The current header has 44 enums (163 values), 101 value structs (539 fields), and 75 pointer-only opaque handles. PR #68's layout test covers the 14 enums and 12 structs present at its branch point, with no discriminant checks; 30 enums and 89 structs were added afterward. Two covered enums gained five values. Opaque handle internals are deliberately outside the public layout contract.

A main-only experimental probe passed with 803 records: 163 enum values, 101 struct size/alignment records, and 539 offsets. The probe directly compares 134 values against compiled Rust enum variants; nine raw-i32 families use 29 manually recorded expected constants. All emitted C/Rust variant-name pairs were inspected. No mismatch was found within those checked records. The experiment does not directly check enum size/alignment for the 30 newer enums.

Negative controls show the old PR probe is unchanged by a LANCE_ERR_PANIC discriminant mutation and by swapping two LanceSessionCacheStats fields, while the expanded fixed probe detects both. However, its generator currently pairs enum variants by numeric value. Regeneration after swapping two valid values could remap them silently. A permanent probe must match semantic variant identities independently of numeric values and retain the applicable enum-layout checks; do not adopt the temporary generator unchanged or treat the negative controls as a regeneration test.

Completion endpoint scope

Completion is introduced by PR #68, not current main. Deliberately reusing its Copy endpoint in a synthetic test produces two callbacks. Removing Copy makes that exact implicit-reuse test fail with E0382, and the focused async tests remain green. This is optional misuse hardening: explicit Clone can still duplicate completion, and an unused endpoint can be dropped. It is not an exactly-once type guarantee, and no live double callback in the existing scanner path was demonstrated. No new global completion-state mechanism is required solely by this synthetic example.

Author coordination and acceptance of an actual updated integration remain open. The experiments supply the conflict map and validation evidence without inferring ownership transfer from silence.

Permanent current-main ABI regression (2026-11-13 UTC)

PR #222 is merged as 07df7bdf87d633c744ed15b9b62b1abb3a60418f. Its tree is exactly the reviewed/tested 261e9a7 tree 1840ff99f0a98bdb43295a3b36a48c966b1168b2; the assessed target remained 9d7fda2. All ten hosted checks passed, the independent Kimi source review found no blockers, and Gatekeeper recommended approval. This is an independent test contribution; it does not accept or take over the author's async branch.

The permanent probe compares 101 concrete structs / 539 field offsets, 35 typed enums / 134 explicitly associated variants, nine raw-i32 families / 29 named constants, and three Arrow struct size/alignment pairs: 980 semantic records. Header inventory also accounts for 75 pointer-only opaque handles. Unlike the earlier experiment, semantic mappings are explicit rather than regenerated from numeric matches. Its existing ignored native harness entry runs automatically in Linux/macOS CI.

Focused NieR Rust 1.94 execution, the header scanner, existing C/C++ consumers and five expected-failure controls were accepted. Controls cover a changed discriminant, swapped enum identities, swapped same-typed fields, enum representation drift, and an unmapped enumerator; the restored final source passed again. Callback signatures, opaque internals and private Arrow field offsets remain outside this probe. No production ABI changed.

The ABI-expansion checkbox is now complete. Author coordination, completion/bridge integration, preservation of scanner/TLS/panic/retirement semantics and acceptance of a genuinely updated #68 integration remain open. Preserve this permanent probe when that integration is prepared; the earlier temporary generator is historical evidence and is not the delivered implementation. The issue remains open.

Lingua principale
Rust
Stelle
8
Fork
17
Merge medio
1h 14m
PR unite (30g)
89

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lance-format/lance-c

Tutte le issue di lance-format/lance-c

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.