Build jixia with PhysLib's toolchain + tolerant decode#13
Merged
Conversation
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.
There was a problem hiding this comment.
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-toolchaininto the jixia checkout beforelake build, and bump the jixia cache key tojixia-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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
With the path fix (#12), jixia now locates PhysLib's
.oleanfiles but fails to read all 445 with:Lean olean headers are version-locked. PhysLib builds on
leanprover/lean4:v4.29.1; jixia'smainis onv4.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 hashesphyslib/lean-toolchain— but the override step was missing.)A second, latent bug sits right behind it: once oleans load,
load_declarationcrashes withUnicodeDecodeError: byte 0x86when slicing the raw.leanbytes by a range that doesn't fall on a UTF-8 boundary.What
cp physlib/lean-toolchain jixia/lean-toolchainbeforelake build(v4.29.0 → v4.29.1, a single patch bump). Bump the jixia cache key tojixia-v2-…so the stale v4.29.0 binary isn't restored.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.