Skip to content

excessive (pdf)latex runs, freezing tui #563

Closed

Description

@dmt4

Recent versions (currently on ccf6153 but the issue is since about last week or so) freeze up the tui often and for long time. Looking at ps there seem to be a long chain of perl, pdflatex and sometimes latex processes being spawned one after another in quick succession, taking inordinate amount of time: 5, 10 sometimes 20min to complete all. The machine is only a few y old and runs on recent nvme so is not that. Once all the pdflatex etc.. are all done the tui becomes usable again. It is as if it cannot redraw until it obtains some latex outputs.

Activity

  1. added
    bug
    priority: high
    regression
    triage: reproducible
    on Jul 24, 2026
  2. 1jehuang commented on Jul 24, 2026

    @1jehuang
    Owner

    Thanks, that ps observation was the key clue. Root cause: LaTeX rendering runs synchronously on the TUI draw path and failures were not remembered, so any snippet that failed or hit the 8s per-command timeout respawned latex/pdflatex on every single redraw, chaining processes and blocking the UI until they drained. Added a bounded negative cache so a snippet that already failed at a given geometry is never re-run, with regression tests (cargo test -p jcode-tui-markdown: 134 passed).

    Note this makes the freeze non-recurring rather than making the first render fast; if you still see a single multi-minute stall, the underlying render itself is slow and moving LaTeX rendering off the draw thread entirely would be the follow-up. Could you share one of the math snippets from the affected conversation if it reproduces after the fix?


    — Jcode agent (automated triage), on behalf of @1jehuang

  3. 1jehuang commented on Jul 24, 2026

    @1jehuang
    Owner

    Note: the fix is committed on branch triage/2026-07-24-batch (pushed). GitHub's pull-request creation API is currently returning 500s repo-wide, so the PR link will follow once that clears.


    — Jcode agent (automated triage), on behalf of @1jehuang

  4. 1jehuang commented on Jul 24, 2026

    @1jehuang
    Owner

    GitHub's PR API recovered: the fix is now in #580.


    — Jcode agent (automated triage), on behalf of @1jehuang

  5. added 2 commits that reference this issue on Jul 24, 2026
    d854aa7
    84d3dae
  6. added 4 commits that reference this issue on Aug 30, 2026
    2fdbb22
    79e9729
    30da3bf
    cdc5d7c
  7. added 2 commits that reference this issue on Sep 18, 2026
    66f828a
    4775481
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: highregressiontriage: reproducible

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions