Skip to content

Build jixia with PhysLib's toolchain + tolerant decode#13

Merged
Gabrielebattimelli merged 1 commit into
mainfrom
add-agent-skill
Jun 3, 2026
Merged

Build jixia with PhysLib's toolchain + tolerant decode#13
Gabrielebattimelli merged 1 commit into
mainfrom
add-agent-skill

Conversation

@Gabrielebattimelli
Copy link
Copy Markdown
Member

Why

With the path fix (#12), jixia now locates PhysLib's .olean files but fails to read all 445 with:

uncaught exception: failed to read file '.../Physlib/....olean', incompatible header

Lean olean headers are version-locked. PhysLib builds on leanprover/lean4:v4.29.1; jixia's main is on v4.29.0, and nothing overrode it at build time — so the jixia binary can't read PhysLib's oleans. (The workflow author intended alignment — the jixia cache key already hashes physlib/lean-toolchain — but the override step was missing.)

A second, latent bug sits right behind it: once oleans load, load_declaration crashes with UnicodeDecodeError: byte 0x86 when slicing the raw .lean bytes by a range that doesn't fall on a UTF-8 boundary.

What

  • Build jixia with PhysLib's toolchain: cp physlib/lean-toolchain jixia/lean-toolchain before lake build (v4.29.0 → v4.29.1, a single patch bump). Bump the jixia cache key to jixia-v2-… so the stale v4.29.0 binary isn't restored.
  • Tolerant decode: decode signature/value byte-ranges with errors="replace" so a non-aligned range can't abort the whole load.

Risk

Assumes jixia compiles on v4.29.1 (one patch up). If it doesn't, the Build jixia step will fail and we revisit.

jixia reads PhysLib's compiled .olean files, whose headers are locked to
the exact Lean version. jixia (v4.29.0) could not read PhysLib's oleans
(v4.29.1), failing every module with 'incompatible header'. Copy
physlib/lean-toolchain into jixia before 'lake build' so versions match,
and bump the jixia cache key to discard the stale binary.

Also decode declaration signature/value byte-ranges with errors='replace'
so a range that doesn't fall on a UTF-8 boundary can't abort the load.
Copilot AI review requested due to automatic review settings June 3, 2026 17:26
@Gabrielebattimelli Gabrielebattimelli merged commit 2914c68 into main Jun 3, 2026
1 check passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes jixia/PhysLib interoperability in the weekly indexing workflow by ensuring jixia is built against the same Lean toolchain as PhysLib (so it can read PhysLib’s version-locked .olean headers) and makes declaration extraction resilient to non–UTF-8-aligned byte ranges when slicing source content.

Changes:

  • Update the weekly GitHub Actions workflow to copy physlib/lean-toolchain into the jixia checkout before lake build, and bump the jixia cache key to jixia-v2-… to avoid restoring an incompatible binary.
  • Make signature/value extraction tolerant to invalid UTF-8 boundaries by decoding sliced byte ranges with errors="replace".

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
database/jixia_db.py Prevents UnicodeDecodeError when decoding declaration signature/value slices that don’t align to UTF-8 boundaries.
.github/workflows/weekly-index.yml Ensures jixia is built with PhysLib’s Lean toolchain and avoids restoring stale build artifacts via a bumped cache key.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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