AGENT SKILL

pbinfo-python-jit

Makes Python solutions pass strict time limits on pbinfo.ro by embedding compiled x86-64 shellcode and executing it via ctypes + mmap. Use this skill whenever the user has a Python solution that is correct but gets TLE (Limita de timp depășită / Depășit) on pbinfo, especially when N is around 10^6 and the bottleneck is a sieve, BFS, sliding window, dynamic programming, or any tight Python loop. Also use when the user wants 100p Python on pbinfo problems that pure Python stdlib cannot reach (numpy is not available there). This skill extends the competitive-programming-solver skill — load that one too for the general workflow, then come here for the shellcode escalation. Trigger phrases include pbinfo Python TLE, Python pică pe pbinfo, vreau 100p Python, and Python prea lent pe judece românesc.

License 许可
MIT
最近更新
2026-11-02
Stars
★ 0
Forks
0

01 前言 Front Matter

name
pbinfo-python-jit
description
Makes Python solutions pass strict time limits on pbinfo.ro by embedding compiled x86-64 shellcode and executing it via ctypes + mmap. Use this skill whenever the user has a Python solution that is correct but gets TLE (Limita de timp depășită / Depășit) on pbinfo, especially when N is around 10^6 and the bottleneck is a sieve, BFS, sliding window, dynamic programming, or any tight Python loop. Also use when the user wants 100p Python on pbinfo problems that pure Python stdlib cannot reach (numpy is not available there). This skill extends the competitive-programming-solver skill — load that one too for the general workflow, then come here for the shellcode escalation. Trigger phrases include pbinfo Python TLE, Python pică pe pbinfo, vreau 100p Python, and Python prea lent pe judece românesc.

02 资源文件 1

03 SKILL.md 正文

Pbinfo Python JIT — Shellcode Escalation

When a Python solution on pbinfo.ro is algorithmically correct but too slow for the judge's tight time limits, this skill enables a final-resort technique: embed compiled x86-64 machine code as a bytes literal in the Python source, then load it into executable memory via mmap + ctypes and call it as if it were a normal C function.

This bypasses CPython's interpreter overhead entirely for the hot path. It has consistently moved Python solutions from 35–65 points to 100 points on problems like bunrau, xk, bitmove, and divq.

When to use this skill

Only after the general competitive-programming-solver skill's Python techniques (bulk read, array.array, slice-assign sieves, ASCII digit-parity trick, linear sieves) have been tried and still TLE. Shellcode JIT has a setup cost — don't reach for it on easy problems.

Use shellcode when:

  • pure Python stdlib version of an N=10^6 algorithm runs in ~2–3+ seconds locally (will TLE on judge)
  • the algorithm is a tight inner loop: nested sieves, sliding window with while, BFS over millions of edges, DP over a grid
  • the user has explicitly run out of options ("am încercat tot, tot pică")
  • the user has confirmed (via bunrau_diag6.py or prior experience) that pbinfo's sandbox allows PROT_EXEC on mmap pages

Don't use shellcode when:

  • the problem fits in pure Python with the right algorithm
  • the user is targeting a judge other than pbinfo (most judges' sandboxes block PROT_EXEC)

Pbinfo sandbox capabilities (verified)

The shellcode JIT workflow

Step 1: Write the hot path in C

Step 2: Compile with these specific flags

Step 3: Verify no relocations

Step 4: Extract the .text section and symbol offsets

Step 5: Build the Python wrapper

etc.

4KB pages are usually enough; round up to the next multiple of 4096 if needed

Build function pointers using CFUNCTYPE

...

Allocate buffers in Python and pass them in

04 同仓库更多 Skills

Prekzursil
Prekzursil/agent-skills-toolchain

clarify-requirements

Resolve genuine pre-execution ambiguity by scanning repo context, generating 1-6 grounded options, and asking 1-3 focused questions via AskUserQuestion. NOT for mid-task use (injection risk); NOT when the goal is already unambiguous; use to disambiguate vague prompts before any file edits.

★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

openmm-md

Run FREE, open-source, Windows-native GPU molecular dynamics via the openmm-md MCP (OpenMM + CUDA on the local NVIDIA GPU). Use for protein / protein-ligand MD when you want a free stack or are on Windows without a Schrodinger license. Covers the full workflow (prepare, solvate, minimize, equilibrate, production, analyze, mmgbsa) AND an honest decision guide vs Schrodinger Desmond, including how to run Desmond legitimately on Linux or a cloud GPU with a real license. This is a deliberately LESSER free alternative and does NOT replace the schrodinger MCP tools. Do NOT use it to pick a free tool when a validated FEP+, WaterMap, IFD-MD, or Prime MM-GBSA result is actually required.

Skill与智能体开发
★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

visual-review

Take screenshots of web pages and UI using Playwright for visual review and iteration

演示文稿测试与质量
★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

status

Diagnostic status report — shows metaswarm installation state, project setup, and potential issues

★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

start

Use when starting work on any task, when the user mentions metaswarm, or when the user wants to begin tracked development work

Skill与智能体开发
★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

setup

Interactive project setup — detects your project, configures metaswarm, writes project-local files

★ 0