Skip to content

Comments

Updates#1

Merged
jgarzik merged 3 commits intomainfrom
updates
Feb 21, 2026
Merged

Updates#1
jgarzik merged 3 commits intomainfrom
updates

Conversation

@jgarzik
Copy link
Owner

@jgarzik jgarzik commented Feb 21, 2026

No description provided.

jgarzik and others added 2 commits February 21, 2026 17:30
Project has grown from ~10K to ~74K lines, 46 to 106 opcodes, 12 to 27+
types, 7 to 49+ builtins, 17 to 114 tests. Add sections for language
features, modules, GC, and expand project structure with all current files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add .github/workflows/ci.yml that builds and runs make check +
make check-cpython on ubuntu-latest x86-64. Update README to
emphasize io_uring as primary async I/O backend.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Without this, ubuntu-latest defaults to Python 3.10, producing wrong
.pyc magic numbers and failing _sre.MAGIC assertions in test_sre.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jgarzik jgarzik merged commit 984c20f into main Feb 21, 2026
1 check passed
@jgarzik jgarzik deleted the updates branch February 21, 2026 17:34
Copy link

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

Updates repository documentation and adds CI automation, while removing two standalone markdown docs.

Changes:

  • Remove opt-peephole.md and audit.md.
  • Expand README.md with updated feature list, project structure, and testing instructions.
  • Add a GitHub Actions workflow to build and run both test suites on PRs/pushes.

Reviewed changes

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

File Description
opt-peephole.md Removes the peephole optimization guide document.
audit.md Removes the 3.12 compliance gaps audit document.
README.md Updates/expands project description, features, structure, and test instructions.
.github/workflows/ci.yml Adds CI to build and run make check and make check-cpython.

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

Comment on lines +11 to 14
- **~74K lines of hand-written x86-64 NASM assembly** — no C runtime, no generated code
- **128-bit fat values** — inline integers, floats, bools in 16-byte (payload, tag) pairs, skipping heap allocation and refcounting entirely
- **SmallStr optimization** — strings up to 15 bytes stored inline in the 128-bit value slot, zero allocation
- **Raw Linux syscalls** — no libc dependency for I/O; buffered writes via direct `syscall`
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

README claims “no C runtime”, but the build links against libc (-lc) and parts of the runtime (e.g., the poll I/O backend) call libc symbols. Consider rephrasing to something like “no C source / mostly assembly” or clarify the limited libc dependency (primarily for libgmp/poll).

Suggested change
- **~74K lines of hand-written x86-64 NASM assembly** — no C runtime, no generated code
- **128-bit fat values** — inline integers, floats, bools in 16-byte (payload, tag) pairs, skipping heap allocation and refcounting entirely
- **SmallStr optimization** — strings up to 15 bytes stored inline in the 128-bit value slot, zero allocation
- **Raw Linux syscalls**no libc dependency for I/O; buffered writes via direct `syscall`
- **~74K lines of hand-written x86-64 NASM assembly** — no C source / mostly assembly; minimal libc usage (link for libgmp and platform glue)
- **128-bit fat values** — inline integers, floats, bools in 16-byte (payload, tag) pairs, skipping heap allocation and refcounting entirely
- **SmallStr optimization** — strings up to 15 bytes stored inline in the 128-bit value slot, zero allocation
- **Raw Linux syscalls** — I/O hot paths use direct `syscall`; limited libc usage in the poll/epoll fallback layer

Copilot uses AI. Check for mistakes.
Comment on lines 14 to +18
- **Raw Linux syscalls** — no libc dependency for I/O; buffered writes via direct `syscall`
- **256-entry jump table dispatch** — single indirect jump per opcode
- **GMP for arbitrary precision** — big integers via libgmp when values exceed tagged pointer range
- **Reference counting** — deterministic memory management with tagged pointer awareness
- **GMP for arbitrary precision** — big integers via libgmp when values exceed SmallInt range
- **Reference counting + cycle-collecting GC** — deterministic memory management with a 3-generation collector for cycles
- **Full async/await with io_uring** — high-speed async I/O via Linux io_uring (with epoll fallback), zero-copy TCP streams
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

These bullets say there is “no libc dependency for I/O” and that the async I/O backend falls back to “epoll”, but the codebase includes a libc poll()-based backend (see src/pyo/eventloop_poll.asm) and the link flags include -lc. Please align the README wording with the actual fallback/backend and libc usage (e.g., “poll() fallback” / “uses libc poll() for fallback”).

Copilot uses AI. Check for mistakes.
./apython --version # show version

# run a Python script
python3 -m py_compile script.py
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

Quick start uses python3 -m py_compile ..., but apython validates .pyc files as Python 3.12 specifically (and the test tooling expects .cpython-312.pyc). Using a non-3.12 python3 will generate incompatible .pyc files. Recommend documenting python3.12 -m py_compile explicitly (or note the requirement that python3 must be 3.12).

Suggested change
python3 -m py_compile script.py
python3.12 -m py_compile script.py

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +25
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y nasm libgmp-dev

- name: Build
run: make

Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

CI runs make check / make check-cpython, but the test harness and Makefile hardcode cpython-312 .pyc filenames while invoking python3. On ubuntu-latest, python3 may not be 3.12, which will cause missing .cpython-312.pyc artifacts and skipped tests or failures. Pin/install Python 3.12 (e.g., actions/setup-python with 3.12 and/or ensure python3 points to 3.12) or update the test commands to explicitly use python3.12 / version-detected .pyc naming.

Copilot uses AI. Check for mistakes.
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.

1 participant