Commit Graph
11 Commits
Author SHA1 Message Date
youknowdot 72a6330b3c Match Python 3.15 repetition specialization and keep universal tests
Use exact sequence-type guards and preserve generic fallback diagnostics. Validate both cold and warmed expressions without implementation-specific assertions. Reject stale CPython source checkouts and cross-version library caches.

Assisted-by: OpenAI Codex:model identifier unavailable
2026-10-10 00:59:33 +09:00
youknowdot 6c2529800a Target Python 3.15 using the final upstream reference
Update active version and comparison configuration to Python 3.15.0. Preserve the alpha implementation status, actual bytecode format, and existing libraries pending separate migration. Align generated library-upgrade workflow pins without changing permissions or actions.

Assisted-by: OpenAI Codex:model identifier unavailable
2026-10-10 00:53:45 +09:00
Jeong, YunWon a28ff42345 Flatten Python eval loop with trampoline for reduced call overhead (#8431)
* Factor with_iframe into enter_iframe/exit_iframe helpers

Extract the frame entry (recursion check, TLS link, exception save)
and exit (materialization sync, TLS restore, GC tracking) logic
from with_iframe into standalone enter_iframe/exit_iframe methods.
with_iframe now calls them, with no behavioral change.

This prepares for the trampoline loop where enter/exit are called
individually rather than wrapped around a closure.

Assisted-by: Claude

* Allocate InterpreterFrame and LocalsPlus together on the datastack

Add InterpreterFrame::new_on_datastack() that bump-allocates both the
InterpreterFrame struct and its LocalsPlus data array in a single
datastack push, eliminating one allocation per function call.

Update datastack_frame_size_bytes_for_code() to include InterpreterFrame
size. Convert invoke_prepared_exact_args() and the invoke() fast path to
use the combined allocation.

Add release_datastack_frame() method on InterpreterFrame that drops all
localsplus values, runs field destructors (trace, temporary_refs,
retained_back, etc.), and returns the datastack base pointer for pop.

Assisted-by: Claude

* Implement trampoline loop for Python-to-Python calls

Add ExecutionResult::TailCall variant and a trampoline in
run_frame_fast that flattens Python-to-Python calls into a single
Rust stack frame instead of recursing through the eval loop.

CallPyExactArgs now prepares the callee frame on the datastack and
returns TailCall when tailcall_enabled is set (run_iframe path only).
The trampoline dispatches via a state machine (EnterCallee / ReturnValue
/ Unwind) in a single loop, avoiding mutual recursion between helper
functions that would exhaust the C stack.

Exception propagation through suspended frames uses
trampoline_handle_exception which adds traceback entries and calls
unwind_blocks on each caller.

Assisted-by: Claude

* Optimize trampoline: skip recursion check, avoid temporary_refs mutex, add bound method TailCall

- Add enter_iframe_unchecked for trampoline callee entry (recursion
  already checked by specialization_call_recursion_guard)
- Move callable ownership from per-frame temporary_refs mutex to
  trampoline-local SuspendedFrame.owned_refs via VM side channel
- Add TailCall support for CallBoundMethodExactArgs
- Move args directly from caller stack to callee fastlocals
- Read materialized pointer once in exit_iframe

Incremental call overhead: ~55 ns -> ~35 ns

Assisted-by: Claude

* Use UnsafeCell for pending_tailcall_refs

The VM is per-thread so RefCell's runtime borrow checking is
unnecessary overhead. Replace with UnsafeCell for direct access.

Assisted-by: Claude

* Remove .claude/settings.json from tracking

Assisted-by: Claude

* Replace SendPtr with Option<SendNonNull> for type-safe pending tailcall

Use NonNull + Option instead of raw *mut T with manual null checks.
The compiler enforces non-null via the type system, and Option<NonNull>
has the same size as a raw pointer thanks to niche optimization.
Also extract take_pending_tailcall helper to deduplicate the pattern.

Assisted-by: Claude

* Restrict PendingFrame to private, expose only set/take methods

Rename SendNonNull to PendingFrame and make it fully private: the
struct, its field, and the pending_tailcall_frame Cell are all
non-pub. External code accesses the side channel only through
set_pending_tailcall (pub(crate)) and take_pending_tailcall (private).

This ensures the unsafe Send+Sync impl cannot be reused elsewhere
without justifying a new safety argument.

Assisted-by: Claude

* Restore C-stack overflow check in trampoline enter_iframe_unchecked

enter_iframe_unchecked was skipping C-stack checks under the
assumption that the trampoline stays in one Rust stack frame. But
each run_iframe call still consumes Rust stack, so deep Python
recursion through the trampoline can exhaust the C stack (observed
as STATUS_STACK_OVERFLOW on Windows CI).

Keep the C-stack check (every 8th call) while still skipping the
Python recursion depth check (already done by
specialization_call_recursion_guard).

Assisted-by: Claude

* Address code review: entry frame double-free, panic safety, cleanup

- Fix double-free: mark entry frame with is_entry flag in
  SuspendedFrame so the trampoline skips its datastack release
  (the caller owns that cleanup)
- Clear iframe.previous in exit_iframe before unlinking the chain,
  matching with_frame and resume_gen_frame behavior
- Add scopeguard in with_iframe for panic safety
- Use saturating_sub(1) for lasti in trampoline_handle_exception
- Extract datastack_iframe_localsplus_offset helper to avoid
  duplicated alignment computation

Assisted-by: Claude
2026-08-05 13:10:14 +09:00
Bas Schoenmaeckers cd75e2a6df Convert claude skills to more generic agent skills (#8064)
Assisted-by: Codex:gpt-6
2026-06-11 12:13:25 +09:00
Claude e77a8b7745 Add SessionStart hook for dev environment setup
Configures automatic development environment setup for Claude Code web
sessions: upgrades python3 to 3.13+ and clones CPython source if missing.

https://claude.ai/code/session_01VPT2fpdf52qFZLMN8EDNgp
2026-03-04 17:53:05 +09:00
Jeong, YunWon c0a436ffbd command /apple-container (#6998)
Assisted-by: Codex:gpt-6
2026-02-05 10:20:48 +09:00
Lee Dogeon 0c174624b4 Introduce /upgrade-pylib-next (#6827)
* Simplify upgrade-pylib.md by removing manual copy steps handled by quick command

* Let upgrade-pylib run auto-mark instead marking manually

* Let upgrade-pylib a separate commit from updating module

* Correct commands' permissions

* Add open PR check to upgrade-pylib-next command

* Fix dependency pattern example in upgrade-pylib-next command

* Let upgrade-pylib command to invetigate failing tests

* Add pre-commit review to invetigate-test-failure command

* Use deps command to get dependent tests in upgrade-pylib workflow
2026-01-31 07:40:39 +09:00
Jeong, YunWonandgithub-actions[bot] 5ef8d48e5a update_lib hard dependency resolver (#6817)
* update_lib __init__ handling

* dependency

* Auto-format: ruff format

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-20 23:52:28 +09:00
Jeong, YunWon d119c47d2e Remake update_lib 2026-01-20 11:38:26 +09:00
Lee Dogeon 3d86b26caf Complement upgrade-pylib Claude Code command (#6742)
* Insert unittest import line if it doesn't exist

* Complement upgrade-pylib Claude Code command

* Ensure test module having import statement at least one
2026-01-17 21:54:16 +09:00
Jeong, YunWon 7a516c44c9 Update AI docs (#6728)
* update copilot instructions

* upgrade-pylib command
2026-01-14 23:51:41 +09:00