XCPC Workstation — A Local-First Rust + Typst Workstation for Competitive Programming

Правка en1, от chumeng, 2026-11-22 17:28:34

Introduction

Hi Codeforces,

I would like to introduce XCPC Workstation — a local-first, open-source desktop workstation for competitive programming, built from the ground up in Rust and powered by Typst.

It is a ground-up successor to my earlier browser-based project, xcpc-statement-generator. While the original tool focused solely on web-based statement editing, XCPC Workstation is designed as a complete personal competitive programming environment: a local problem library at the foundation, live-referenced contest composition and PDF publishing, and (in upcoming phases) a local deterministic Polygon workflow and training dashboard.

The first public beta focuses on the authoring and publishing pipeline, which is now ready for daily use.

Publishing Studio

You can download prebuilt binaries (Windows and Linux) from GitHub Releases, or check out the source code on GitHub.

Why a Native Rewrite?

In practice, preparing a contest involves much more than formatting a single statement: reusing problems across rounds, keeping track of edits in Git, maintaining consistent PDF layouts across problems and editorials, and iterating quickly without waiting seconds for LaTeX recompilation.

XCPC Workstation addresses this with a single shared Rust core that drives the native desktop GUI, a headless CLI (xcpc), and a stdio MCP server (xcpc mcp).

Key Features

  • Zero TeX Live, Millisecond Live Preview: Powered by an embedded Typst engine with incremental tiled rasterization. You do not need to install a multi-gigabyte TeX distribution, and edits reflect in the preview almost instantaneously.
  • Standard Contest Layouts & Programmable Typesetting: Ships with editable template seeds including olymp-classic (closely aligned with olymp.sty / Polygon-style contest booklets, supporting covers, problem lists, optional blank pages, and A4 editorial booklets) and cnoi-classic (Chinese NOI/CSP-style layout). Native @preview/* package support (with offline fallbacks for cetz, pinit, and mannot) lets you embed vector diagrams and annotated formulas directly inside Markdown via ```typst blocks.
  • Local-First, Git-Friendly Problem Library: Every problem lives in a plain-text directory (problem.toml, statement.md, editorial.md, samples/, assets/). There is no opaque database locking your content in, making Git version control straightforward.
  • Live-Referenced Contests & Immutable Snapshots: Contests reference problems from your library by ID with optional per-contest metadata overrides (title, time/memory limits, template options). Fixing a typo in the library updates all unfrozen contests automatically. When a contest is finalized, freezing it runs preflight checks and snapshots all source files, active templates, and rendered PDFs into snapshot/ as a read-only archive.
  • Customizable Templates & Themes: Every template is a regular .typ file on disk (templates/*.typ or per-contest contests/<id>/template.typ) with a declarative #let schema that automatically renders layout controls in the Inspector panel. Workspace-level .xcpc/preamble.typ macros and theme.toml customization are also supported.
  • Built for Problem Authors: Includes / slash commands (math blocks, matrices, piecewise functions, subtask tables, Typst blocks), floating math previews while editing, a split-pane sample editor with drag-and-drop reordering, a lightweight asset gallery, focus mode, and an optional Vim mode.
  • First-Class CLI & AI Agent (MCP) Support: The xcpc CLI supports building, checking, and rendering contests/problems (with --json output for CI). Running xcpc mcp exposes library search, statement editing, contest composition, diagnostics, and PDF export to MCP-compatible AI assistants (Claude, Cursor, Codex, etc.), with an optional --read-only flag for safe proofreading and diagnostics. External edits sync back to the open desktop app live without losing cursor state.

Problem Library

Getting Started

Prebuilt packages are available on GitHub Releases for: - Windows (x86_64): per-user installer (.exe, with auto-update) and portable .zip - Linux (x86_64): .deb, Arch .pkg.tar.zst, AppImage, and .tar.gz - Headless CLI / MCP: standalone xcpc binaries for servers and agent workflows

The desktop app includes a built-in example workspace — click "Open Example" on first launch to try the editor, templates, and PDF export immediately.

Roadmap

  • Phase 3 — Local Polygon (Planned): Reproducible, cross-platform problem package building and stress testing using wasi-sdk + Wasmtime with fuel-based deterministic tick limits (inspired by Hull, without requiring Nix), alongside Polygon ZIP package import.
  • Phase 4 — Training & OJ Sync (Planned): Codeforces / AtCoder / QOJ submission sync, training analytics, contest retrospectives, and an upsolving queue.

Feedback & Contributions

XCPC Workstation is licensed under Apache-2.0 and is currently in Public Beta. If you encounter bugs, layout discrepancies, or have suggestions for the authoring workflow, please open an issue on GitHub or leave a comment below.

Thanks for reading!

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский chumeng 2026-11-27 16:54:11 0 (published)
en3 Английский chumeng 2026-11-27 16:53:45 97
en2 Английский chumeng 2026-11-27 16:53:11 17317
en1 Английский chumeng 2026-11-22 17:28:34 6008 Initial revision (saved to drafts)