Testing
~8 min readUpdated: December 2026

NetHack+ & Prime-Agent-Explore: O(1) Checkpointing for Long-Horizon Agents

NetHack+ O(1) Checkpointing and Prime-Agent-Explore Long-Horizon Agent Search in Smoke Monkey

Released in arXiv:2612.06161, NetHack+ upgrades the NetHack Learning Environment with O(1) state save/restore/branching, 2.1x faster throughput (thousands of environments per process), 17 difficulty knobs, and 12 observation formats. Paired with Prime-Agent-Explore (PAE), BAL_min climbs 8.6x (1.32% to 11.38%) while cutting cost by 94%.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

NetHack+ & Prime-Agent-Explore: O(1) Checkpointing for Long-Horizon Agents: Released in arXiv:2612.06161, NetHack+ upgrades the NetHack Learning Environment with O(1) state save/restore/branching, 2.1x faster throughput (thousands of environments per process), 17 difficulty knobs, and 12 observation formats. Paired with Prime-Agent-Explore (PAE), BAL_min climbs 8.6x (1.32% to 11.38%) while cutting cost by 94%. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.

Key Architectural Takeaways
Quick Implementation Examplenethack-plus-checkpoint-agent.ts
nethack-plus-checkpoint-agent.tstypescript
import { createAgent } from '@smoke-monkey/harness';
// Long-horizon agent orchestrating NetHack+ O(1) checkpoints and JSON map observations
const agent = createAgent({
agentId: 'pae-checkpoint-explorer',
provider: 'openai-compatible',
baseUrl: 'https://api.deepseek.com/v1',
model: 'deepseek-v4.1-flash',
workspacePath: process.cwd(),
permissions: {
read_file: 'allow',
write_file: 'allow',
run_command: 'ask',
},
});
async function main() {
const result = await agent.run(
'Execute a 30-budget Prime-Agent-Explore evaluation against the NetHack+ Verifiers bridge, checkpointing before descending each dungeon level and logging BAL_min.'
);
console.log('PAE Benchmark Summary:', result.summary);
}
main().catch(console.error);
Video Guides

Watch: Related Video Guides

Reinforcement Learning for Long-Horizon Interactive LLM Agents (Feb 2025)

Rethinking Environments for Long-Horizon Work — Rayan Garg, Theta Software

What Is NetHack+ and Why Does BAL_min Fix Long-Horizon Agent Evaluation?

NetHack+ (arXiv:2612.06161) is a refactored, multi-environment roguelike benchmark offering O(1) state checkpointing, 2.1x higher throughput than NLE (at 64 games/thread), 17 runtime difficulty knobs, and 12 observation formats. To stop agents from gaming BAL_max by diving deeper without leveling up, the authors introduce `BAL_min` (the minimum of depth and experience progression).

Pairing Prime-Agent-Explore (PAE)—an orchestrator that branches from saved checkpoints—with NetHack+ lifts BAL_min from 1.32% to 11.38% in 30 attempts (exceeding the 92nd human percentile) while dropping per-game LLM cost by ~94%:

Agent / Harness SetupAttemptsMean BAL_minMedian BAL_minHuman PctileMean Cost / Game
Human Baseline (46,796 runs)15.41 ± 0.062.1252.4%—
Prime Agent + NetCore (GLM-5.2)11.32 ± 0.301.8541.6%$0.90 (vs $82.61 BALROG)
Prime Agent + NetCore (DeepSeek V4.1 Flash)1—1.81—$0.03 (vs $0.99 BALROG)
Best@30 Independent (GLM-5.2)304.15 ± 0.463.6976.4%—
PAE + Explore (GLM-5.2, Full Vision)3011.38 ± 1.3311.7092.0%Checkpointed search
PAE + Explore (GLM-5.2, Full Vision)10020.43 ± 2.5217.9194.3%Checkpointed search
PAE + Explore (GLM-5.2, Fog-of-War)306.03 ± 0.585.0885.8%Beats GPT-6 Astra (4.0% BAL_min)

Why Observation Formats and Skill Surfaces Dictate Agent Reliability

The NetHack+ ablations quantify how seemingly minor harness bugs distort agent benchmarks. Refreshing the ASCII map only on demand caused 9.7% of melee_attack(x,y) calls to hit empty tiles; streaming an ASCII map every turn cut misfires to 2.4%, and streaming a structured JSON map dropped misfires to 0%. Similarly, pre-opening standard doors reduced np_kick() calls from 4.9% to 3.9% and boosted BAL_min by +33%:

python
# Example NetHack+ Gym / Verifiers checkpoint-and-branch loop
import nethack_plus as nhp

env = nhp.make("NetHackPlus-v0", obs_format="json", action_surface="netcore")
obs, info = env.reset(seed=42)

# Save O(1) snapshot before risky combat or level descent
checkpoint_id = env.save_state()
obs_next, reward, terminated, truncated, step_info = env.step("np_explore_level")

if step_info["hp_ratio"] < 0.25:
    # Branch back instantaneously instead of restarting a fresh episode
    obs = env.restore_state(checkpoint_id)

Generalization Beyond NetHack

The authors verified Prime-Agent-Explore across MiniHack, Crafter, and TextWorld—improving over single-attempt runs on all three and reaching the highest reported score on TextWorld.

Bringing O(1) Branching & Structured State Into Coding Harnesses

Software engineering agents suffer from the exact same trajectory collapse seen in roguelikes: one broken migration or stale file diff wastes 20 subsequent turns. Smoke Monkey Harness mirrors NetHack+'s lessons by pairing git-backed workspace checkpoints (Recover phase) with structured AST/JSON file views rather than brittle screen-scraping.

Instead of spending $82+ per long-horizon run on raw unguided retries, engineers combine cheap fast models (DeepSeek V4.1 Flash at $0.03/run) with checkpointed verification branches.

Google Search Questions & Answers

Frequently Asked Questions

Q:What is BAL_min in the NetHack+ paper?

BAL_min takes the lower of an agent’s human-normalized dungeon depth (Dlvl) and experience level (XL) scores, preventing agents from inflating scores by rushing down stairs without gaining combat experience.

Q:How much faster is NetHack+ than the original NetHack Learning Environment (NLE)?

NetHack+ runs at 2.1x NLE’s throughput at 64 games per thread, supports thousands of environments per process, and adds O(1) save, restore, and branching.

Q:How did JSON map observations affect combat accuracy?

Streaming only on-demand maps caused 9.7% of melee_attack(x,y) tool calls to target empty tiles. Streaming ASCII every turn lowered misfires to 2.4%, and streaming JSON maps eliminated misfires completely (0%).

Q:How much cheaper are NetHack+ + NetCore runs compared to BALROG?

Mean cost per game dropped by roughly 94% across tested models—from $82.61 to $0.90 on GLM-5.2, $75.49 to $10.87 on Gemini-3.1 Pro, and $0.99 to $0.03 on DeepSeek V4.1 Flash.

Related Alternatives & Comparisons

Related Architecture Guides

View all guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness