Files
Nim/tests/ic
araq 2db27d4826 Merge branch 'devel' into araq-ic-fixes2
One conflict, in `canRaiseDisp`, where both sides added to the same guard:

* devel (#26145) short-circuits `skMethod` to "can raise", because a base
  method's inferred effects describe only the base body, not every vtable
  target;
* this branch resets `markCanRaiseBranch` to 5 on entry, so that a `-d:
  icCanRaiseLog` differential attributes an answer to the branch that actually
  decided it rather than to whatever the previous call left behind.

Both kept: the reset first, then devel's method branch, then the existing
flags branch. Marker 5 already means "decided here, neither predicate ran",
which is what the new branch does too, so it needs no new number — the comment
now says both short-circuits land there.

Verified on the merged tree: `tests/ic` 40/40, including devel's new
`timportcalias`; the cursor-driven and `PNode`-driven backends still generate
byte-identical C (67/67 under `--ic:on`); ccgbugs 146, concepts 48, method 22,
destructor 97, arc 140, gc 78, closure 23, iter 71, exception 47, all clean.

`tests/generics/tparser_generator.nim` fails, and does NOT come from this
merge: it fails the same way on pristine `origin/devel`, built and run in a
throwaway worktree to check. The compile succeeds; the spec expects no output
and the compiler now emits `typed`-deprecation and unused-import warnings.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FMyRHByv7hhaQJ4Pa1bHbE
2026-08-30 20:38:00 +02:00
..
2026-06-15 23:33:16 +02:00
2026-06-15 23:33:16 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-15 23:33:16 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-07-10 14:07:35 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-15 23:33:16 +02:00
2026-08-27 19:35:11 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-08-27 19:35:11 +02:00
2026-08-27 19:35:11 +02:00
2021-03-19 16:53:38 +01:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-01-24 06:07:41 +01:00
2026-06-15 23:33:16 +02:00
2026-07-10 14:07:35 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00

Running tests/ic

./bin/testament --nim:<your compiler> cat ic

The metamorphic tests are expensive, and look hung when they are not

16 of the tests carry #? metamorphic. Each has 34 #!STEP directives, and every step compiles the program twice — once under nim ic, once with nim c as the reference oracle. That is 100+ full compilations for the category. Under --ic:on each compilation additionally fans out one backend process per module per stage, and each of those is a compiler holding its own module graph (~800MB peak).

A nim ic parent sitting at 0% CPU is normal. It is waiting on its children. It is not a deadlock, and neither is a metamorphic test that occupies the runner for many minutes. Before concluding anything is stuck, check that the test NAME changes over a few minutes — that is the difference between slow and hung, and it is easy to get wrong.

On a memory-constrained machine the fan-out will swap. The symptoms are exactly the ones that read as a deadlock: several processes at 0% CPU, no output, a different test "stuck" on every run, and the same compilation finishing in seconds when run on its own. Check vm_stat (page-ins per second) and sysctl vm.swapusage before looking for a bug. This was diagnosed as a testament/nim ic interaction more than once before anyone measured.

Cap the fan-out to fit the machine — precedence documented at deps.nim's let parallel:

--parallelBuild:N     # standard flag, given meaning under IC
-d:icJobs:N           # same cap, legacy define
-d:icNoParallel       # serial, and non-interleaved child output

Serial output matters for a second reason: the parallel backend processes share one stderr, so any per-process diagnostic printing (NIM_IC_BNODE_GRIND, -d:icCanRaiseLog) interleaves and produces torn lines. Either use -d:icNoParallel or parse defensively and count what you dropped.

Running a single test

testament r tests/ic/<file>.nim works for the ordinary tests. It does NOT work for the metamorphic ones — the multi-step files carry several discard """ spec blocks and the single-test path rejects them with "duplicate specStart". Those only run through cat ic.

Files matching tests/ic/*_temp.nim are ignored by git (see .gitignore) and are scratch, not tests: several import helper modules that do not exist and fail for that reason alone.