Skip to content

BUG #3359

Description

@linchen-LC

Title: extract --code-only hangs forever on large monorepo (no graph.json written); worker spins 100% in re.sub — reproduced on 0.9.53 and 0.9.54

Environment

  • macOS 15.7.7 (Apple Silicon), Python 3.11.15 (uv-managed), graphifyy 0.9.53 and 0.9.54 (both reproduced)
  • Corpus: DeepSeek Harness monorepo (dsh) v0.1.3-alpha.1, ~2,470 code files after excluding tests/snapshots via .graphifyignore (**/tests/, **/*.spec.ts, **/*.test.ts, **/*.e2e.ts, snapshots/). Total repo incl. tests ≈ 4,037 files.

Steps to reproduce

  1. Add the .graphifyignore exclusions above in repo root.
  2. graphify extract . --code-only (default workers)
    → AST extraction progress freezes: parallel runs stall at ~97–99% (2400/2470; inside packages/ alone 3300/3362; also 3400/3415) and graph.json is never written.
  3. Variants all reproduce: --max-workers 1/2/4/10, --no-dedup, 0.9.53 and 0.9.54.
  4. Serial run (--max-workers 1) freezes earlier at 500/2469 (20%), also indefinitely.
  5. Repo subsets that are small (each top-level dir except packages/) complete fine; a ~60-file repo (xiaohongshu-mcp) completes fine — so not a universal scale issue.

Diagnostics

  • While frozen: the active worker shows 100% CPU and opens NO files (lsof lists only the python binary).
  • sample (macOS) of the spinning worker shows 2485/2485 samples inside _sre_SRE_Pattern_subsre_searchsre_ucs1_match — i.e., a Python re.sub operating on a large UCS-1 (ASCII) string is the hot path. No traceback; process exits only when killed, with resource_tracker semaphore-leak warnings at teardown.
  • Freeze point shifts with file set → looks content-triggered: likely a regex normalization/sanitization pass over large serialized per-chunk/per-file payloads that is pathologically slow (or catastrophic backtracking) for some content in this corpus.

Request
Could you check the post-parse regex normalization paths (e.g., anything running re.sub over chunk/file payloads) for patterns that are linearity-unsafe on large ASCII inputs? Happy to provide more logs/cache entries on request. This blocks graphify extract on moderately large TypeScript monorepos.

Notes

  • I did not retain graphify-out/cache (deleted between retries); can keep it on a repro run if useful.
  • Corpus is a public GitHub repo: deepseek-ai/deepseek-harness (tag v0.1.3-alpha.1).

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions