Skip to content

Descend into a task with the same bookkeeping as an ordinary callsite - #709

Open
jishnub wants to merge 1 commit into
JuliaDebug:masterfrom
jishnub:fix-task-descent-state
Open

jishnub wants to merge 1 commit into
JuliaDebug:masterfrom
jishnub:fix-task-descent-state

Conversation

@jishnub

@jishnub jishnub commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

The TaskCallInfo branch in descend! sets state.ci alone:

state.ci = get_ci(info)::CodeInstance
descend!(state)
continue

Two consequences:

  • state.mi stays the parent's. Every view reads state.miget_typed_sourcetext(state.mi, …) for :source, state.mi.def for :ast and jump, and the (state.mi, result.src) pair handed to _dump_function for :llvm/:native — so descending into a task renders the parent's method with the task's code, and hands codegen a mismatched pair.
  • Nothing restores the parent's state on the way back up, so after ascending the parent's frame keeps the task's ci.

This makes the branch do what the ordinary descent a few lines below already does: save the state, set mi with ci, clear override, descend, honour :exited, restore.

Test (terminal harness): descending into the task callsite of @sync @async show(devnull, "Hello") shows the closure's method as the frame header, and ascending brings back the parent's header and its own callsites. Against master the test fails on all three of those assertions.

Not changed: get_ci(info)::CodeInstance still throws when the task wraps a MultiCallInfo (which callinfo() can return). That is a separate question of what the TUI should offer there.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NiXhCrQf5AJ2DmTmZ3FsSP

The `TaskCallInfo` branch set `state.ci` alone: `state.mi` stayed the
parent's, so every view rendered the parent's method with the task's
code, and `:llvm`/`:native` were handed a mismatched (mi, src) pair. It
also never restored the parent's state on the way back up, so after
ascending the parent's frame kept the task's `ci`.

Do what the ordinary descent a few lines below does: save, set `mi` with
`ci`, clear `override`, descend, restore.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiXhCrQf5AJ2DmTmZ3FsSP
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (2c33b9a) to head (db17250).
⚠️ Report is 101 commits behind head on master.

Files with missing lines Patch % Lines
src/descend.jl 0.00% 10 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #709    +/-   ##
=======================================
  Coverage    0.00%   0.00%            
=======================================
  Files           9      22    +13     
  Lines        1556    1816   +260     
=======================================
- Misses       1556    1816   +260     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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