Skip to content

dotnet: lazy dnfile load, row cap before reading, dot-name fallback, deadline (#29) - #32

Merged
dexRand merged 2 commits into
mainfrom
fix/29-dotnet-lazy-load
Nov 17, 2026
Merged

dexRand merged 2 commits into
mainfrom
fix/29-dotnet-lazy-load

Conversation

@dexRand

@dexRand dexRand commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Closes #29

What

  • dnfile.dnPE(path, clr_lazy_load=True): resources are no longer all read before the caps.
  • Only the first 100 ManifestResource rows are processed (summary says "only the first 100 of N").
  • One 60 s deadline; names empty or only dots become resource{i}; an OSError on one write skips only that resource; dnfile logger at ERROR.

Measured (arbiter, dnfile 0.15.1, real System.Windows.Forms.dll): RSS 461 -> 303 MB on the stock DLL, 1213 -> 335 MB with every row pointing at the largest blob; lazily extracted resources byte-identical to eager get_data (100/100).

How it was worked (mechanus): arbiter round 1 rejected deepseek's 1055ce3 (eager load amplification, .. crash); builder fix d432640; arbiter round 2 approved the code, one mutant (OSError catch removed) survived -> test added by the orchestrator, mutant now killed.

L1: unit 520 passed, 1 skipped (the real-dnfile test: local image predates dnfile; it runs in this PR's L2), lint clean.

Residual risk: parsing a 6 MB assembly still takes ~6 s.

🤖 Generated with Claude Code

dexRand and others added 2 commits November 16, 2026 17:27
…names

- dnfile.dnPE(..., clr_lazy_load=True): eager load read every resource blob
  before the 100/50 MB caps applied (461 MB-1.2 GB RSS on big assemblies)
- only the first 100 ManifestResource rows are processed, reported in summary
- 60 s total deadline, checked between resources
- names '', '.', '..' become resource{i}; OSError on write skips that resource
- dnfile logger raised to ERROR

L1: unit suite 519 passed, 1 skipped (real-dnfile test skipped: no dnfile in
local image, runs in CI). On main's dotnet.py: 6 new tests fail, 8 pass.

Refs #29

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ror-catch mutant)

Arbiter round 2: code approved, the per-resource OSError guard had no test.
Mutant 'try/except around write_bytes removed': 1 failed (this test), 519 passed.
L1: unit 520 passed, 1 skipped (real dnfile, runs in CI L2); lint clean.

Refs #29

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dexRand
dexRand force-pushed the fix/29-dotnet-lazy-load branch from 50abea4 to f6deb57 Compare November 16, 2026 16:27
@dexRand
dexRand merged commit eaae292 into main Nov 17, 2026
6 checks passed
@dexRand
dexRand deleted the fix/29-dotnet-lazy-load branch November 17, 2026 08:25
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.

dotnet: dnfile reads every resource before the caps (6 MB -> 1.2 GB RSS); '..' resource name crashes

1 participant