r/LocalLLaMA · · 3 min read

Gemma 4 12b 8Q Heretic Oneshot Coding

Mirrored from r/LocalLLaMA for archival readability. Support the source by reading on the original site.

Gemma 4 12b 8Q Heretic Oneshot Coding

I was pretty impressed with the Gemma 4 12b release today and saw that the heretic version dropped. I was already getting refusals from the 8Q official model and decided to see how the heretic did oneshotting a retro game. It did so with ease. The single prompt start to finish ate 45k tokens total.

  • Hardware Stack: Ryzen 9 9950X + AMD RX 6800 (16GB VRAM) via Vulkan back-end 32GB 6000 System Ram.
  • Model & Config: H-gemma-4-12B-heretic-Q8.gguf running with 8-bit KV Cache (--cache-type-k q8_0 --cache-type-v q8_0).
  • Generation Speed: Rock solid, staying completely flat between 18.44 t/s and 18.93 t/s across all 4turns.
  • Context Scaling: Speed barely degraded even though active context scaled all the way up to 23,125 tokens by the final turn.
  • The Big Run: Turn 2 generated 4,372 tokens of continuous code (writing the 467-line game) in a single continuous 4-minute stream at 18.76 t/s.
  • Prompt Processing: Started at 228.79 t/s from a clean slate and naturally scaled down to 157.72 t/s as the context depth increased.
  • Cache Efficiency: llama-server successfully utilized context checkpoints and Longest Common Prefix (LCP) similarity, hitting 91.7% and 96.4% cache reuse on subsequent turns to bypass massive re-evaluations.

Here's my llama.cpp. ./llama.cpp/build/bin/llama-server -m /home/dsmason321/models/H-gemma-4-12B-heretic-Q8.gguf -c 256000 --jinja --chat-template-file /home/dsmason321/llama.cpp/models/templates/custom_pub_chat_template_gemma4.jinja --reasoning off --cache-type-k q8_0 --cache-type-v q8_0

Here is the prompt.

Act as an expert Senior Frontend Developer and Game Designer. Your task is to write a complete, fully functional, and visually polished "Retro Cyberpunk Brick Breaker" game contained within a single, self-contained HTML file.

You must deliver the absolute final code without placeholders, ellipses (...), or missing implementations. The game must be fully playable the moment it is saved and opened in a browser.

### Technical Architecture

- Language: HTML5, CSS3, and Vanilla JavaScript.

- Rendering: HTML5 <canvas> API.

- File Structure: Single file. All CSS inside <style> tags, all JavaScript inside <script> tags.

- Assets: NO external images, audio files, or libraries. All visual assets (player paddle, ball, bricks, particles) must be drawn programmatically using Canvas 2D context drawing methods (gradients, rects, arcs).

### Game Mechanics & Specifications

  1. Core Loop: A paddle at the bottom bounces a ball upward to destroy grid-based bricks at the top. Destroying all bricks triggers a "Victory" state; losing the ball past the bottom edge subtracts a life.

  2. Controls: Smooth mouse tracking or Left/Right Arrow keys to move the paddle. Ensure the paddle is securely bounded within the canvas width.

  3. Physics: Realistic angle reflections based on where the ball hits the paddle (hitting the edge of the paddle shoots the ball out at a sharper angle).

  4. Progression & Score:

    - Implement a scoring system (e.g., 10 points per brick).

    - Track player lives (start with 3).

    - Display Current Score, High Score (save/load from localStorage), and Remaining Lives as a clean HUD at the top.

  5. Game States: Clear "Start Screen" (click to play), "Game Over Screen", and "Victory Screen" with an instant keyboard or click restart trigger.

  6. Local LLM Safety Feature (Crucial): Keep the brick grid size modest (e.g., 4 rows by 8 columns) to ensure the loops do not cause performance throttling or memory leaks on lower-compute local inference.

### Aesthetic & Visual Polish

- Theme: Cyberpunk / Neon Synthwave.

- Background: Deep midnight black or dark purple gradient.

- Elements: Use bright neon colors (cyan, magenta, electric lime) for bricks and paddle.

- Juiciness: Implement a simple particle explosion effect when a brick is destroyed (generate 5-8 tiny crumbling particle objects that fade out over a few frames).

- Add a subtle glow effect to the canvas elements using `ctx.shadowBlur` and `ctx.shadowColor`.

### Implementation Requirements

- Wrap the entire script cleanly.

- Ensure all variable initializations, event listeners, state reset loops, and the requestAnimationFrame update loop are completely written out.

- Do not add text commentary before or after the code block so the raw output can be stripped easily. Begin directly with <!DOCTYPE html>.

submitted by /u/devildip
[link] [comments]

Discussion (0)

Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.

Sign in →

No comments yet. Sign in and be the first to say something.

More from r/LocalLLaMA