Human vs machine · on your own GPUHumano contra máquina · na sua placa

Your PC is Earth.
You are the invader.
Seu PC é a Terra.
Você é o invasor.

Space Invaders, flipped. Laya, a small decision model, defends the planet by picking which invader the cannon chases. A one-line rule plays next to it, so you can see who misses more. Space Invaders ao contrário. O Laya, um modelo de decisão pequeno, defende o planeta escolhendo qual invasor o canhão persegue. Uma regra de uma linha joga do lado, pra você ver quem erra mais.

Paste this into your agentCola isso no seu agente Use sapiensinteticos.com/laya-invaders to set up Laya Invaders on my machine. Usa sapiensinteticos.com/laya-invaders pra instalar o Laya Invaders na minha máquina.

Free. MIT. NVIDIA card or plain CPU. Grátis. MIT. Placa NVIDIA ou só o processador.

LAYA / INVADERSRTX 3070 · LOCAL
Live on an RTX 3070. The panel shows the options Laya gets, its probabilities, and when it disagrees with the rule. Ao vivo numa RTX 3070. O painel mostra as opções que o Laya recebe, as probabilidades dele e quando ele discorda da regra.

Why this testPor que este teste

Fast is proven. Good is the question. Rápido já provou. A pergunta é se presta.

Laya doesn't write text. It answers typed questions with probabilities in one forward pass, with zero output tokens: the open take on the "fast thinking" decision models that products like Jev promise.

O Laya não escreve texto. Ele responde perguntas tipadas com probabilidades numa passada só, com zero token de saída: a versão aberta dos modelos de decisão de "pensamento rápido" que produtos como o Jev prometem.

In the Snake demo a planner writes "Best" next to one of the options, so the model never has to judge. Here it does: which threat first.

Na cobrinha um planejador escreve "Best" do lado de uma das opções, então o modelo nunca precisa julgar. Aqui precisa: qual ameaça primeiro.

Which invader does the cannon chase?Qual invasor o canhão persegue?
  1. Atank, 3 columns to the left, lands in 42 ticks, needs 3 hits0.25
  2. Bzigzag, 5 columns to the right, lands in 17 ticks, needs 1 hit, zigzags0.42
  3. Ctank, 8 columns to the right, lands in 30 ticks, needs 3 hits0.33
53.8 msoutput tokenstokens de saída 0pressurepressão overwhelmed

What keeps it fairO que deixa o teste justo

Only one thing changes: who picks the target. Só uma coisa muda: quem escolhe o alvo.

Facts, not adviceFato, não conselho

Each invader comes as plain facts: kind, distance from the cannon, ticks until it lands, hits it takes. No option is marked as the best one.

Cada invasor chega como fato: tipo, distância do canhão, rodadas até pousar e quantos tiros aguenta. Nenhuma opção vem marcada como a melhor.

tank, 3 columns to the left, lands in 42 ticks, needs 3 hits

Order says nothingA ordem não diz nada

With more than 5 invaders on screen, the 5 closest to landing are offered, listed left to right. Position never hints at a ranking.

Com mais de 5 invasores na tela, entram os 5 mais perto de pousar, listados da esquerda pra direita. A posição nunca entrega ranking.

Same handsAs mesmas mãos

Aiming and firing are plain code, identical for both sides. Only the choice of target differs.

Mirar e atirar é código comum, igual pros dois lados. Só a escolha do alvo muda.

Same attackO mesmo ataque

Every invader you drop is recorded with its tick. The bench replays your exact attack against Laya and against the rule: shoot whatever lands first.

Cada invasor que você solta é gravado com a rodada. O teste reproduz o seu ataque exato contra o Laya e contra a regra: atira no que pousa primeiro.

Laya also answers a second question in the same pass (pressure: calm, busy or overwhelmed). The panel shows it; the cannon doesn't use it. O Laya também responde uma segunda pergunta na mesma passada (pressão: tranquila, apertada ou sufocada). O painel mostra. O canhão não usa.

ResultsResultado

The one-line rule wins. A regra de uma linha ganha.

One real human attack, 24 invaders, replayed drop by drop against both brains. Um ataque humano de verdade, 24 invasores, reproduzido invasor por invasor contra os dois cérebros.

One-line ruleRegra de uma linhalands first · 0 mspousa primeiro · 0 ms
23
of 24 heldde 24 seguros · 1 got through1 passou
Laya322M · ~57 ms322M · ~57 ms
22
of 24 heldde 24 seguros · 2 got through2 passaram

They picked the same target 64% of the time. Laya's 22 in the replay matches what the live panel showed while the attack was happening. Os dois escolheram o mesmo alvo em 64% das vezes. Os 22 do Laya na reprodução batem com o que o painel mostrou ao vivo, durante o ataque.

Same attack, two brains, replayed at 1×. O mesmo ataque, dois cérebros, reproduzido em 1×.
A seeded bot pushing harder · 600 ticks · same attack for bothUm bot com semente apertando mais · 600 rodadas · o mesmo ataque pros dois
AttackAtaque RuleRegra Laya Picks in commonEscolhas em comum
Normal52 / 5250 / 5286%
Double energy for the attackerEnergia dobrada pro atacante87 / 8971 / 8735%

The rule wins, and the gap grows with the pressure. The runs are deterministic: the same attack gives the same numbers every time. A regra ganha, e a diferença cresce com a pressão. As partidas são determinísticas: o mesmo ataque dá os mesmos números toda vez.

Fast doesn't mean it knows how to weigh: a decision model only proves itself with a dumb rule next to it. Rápido não quer dizer que sabe pesar: modelo de decisão só prova que vale com uma regra burra do lado.

Run itRodar

Four steps. GPU optional. Quatro passos. Placa opcional.

Python 3.10 or newer. The server listens on your machine only, and the model weights (~0.65 GB) download once, pinned to the revision these numbers came from. Python 3.10 ou mais novo. O servidor só escuta na sua máquina, e os pesos do modelo (~0,65 GB) baixam uma vez, travados na revisão de onde saíram estes números.

KeyTecla
Click a columnClique numa colunaDrop an invader thereSolta um invasor ali
123Runner, zigzag, tankCorredor, zigue-zague, tanque
MSwap the brain: Laya or the ruleTroca o cérebro: Laya ou a regra
TBot attacker on or off (not recorded)Liga ou desliga o bot atacante (não é gravado)
SpaceR+-Pause, new recording, speedPausa, nova gravação, velocidade
  1. Clone and make a virtual envClona e cria o ambiente virtual

    git clone https://github.com/inhabitants/laya-invaders
    cd laya-invaders
    python -m venv .venv
  2. Activate itAtiva

    # Windows
    .venv\Scripts\activate
    # Linux
    source .venv/bin/activate
  3. NVIDIA card: PyTorch with CUDA first (skip on CPU)Placa NVIDIA: PyTorch com CUDA antes (pula na CPU)

    pip install torch --index-url https://download.pytorch.org/whl/cu128
  4. Install, fetch the model, playInstala, baixa o modelo, joga

    pip install -r requirements.txt
    python server.py --download
    python server.py

Then open http://127.0.0.1:8765 (Portuguese on screen: ?lang=pt). No GPU: add --device cpu, around 300 ms per decision, and press - to slow the game down. RTX 50 series needs cu128 or newer. Depois abre http://127.0.0.1:8765 (tela em português: ?lang=pt). Sem placa: acrescenta --device cpu, uns 300 ms por decisão, e aperta - pra deixar o jogo mais lento. RTX série 50 pede cu128 ou mais novo.

Replay your own attackReproduz o seu ataque

While you play, the panel shows REC and every drop lands in attacks/. When you're done, in the browser console:

Enquanto você joga, o painel mostra REC e cada invasor fica salvo em attacks/. Quando terminar, no console do navegador:

layaInvaders.runHuman()   // your latest attack vs both brains
layaInvaders.summary()

FAQ

Before you invade. Antes de invadir.

So Laya is bad?

Not what this shows. It shows that under pressure, with raw facts and no hint, a one-line rule beats it at triage. Speed was never the question: ~57 ms per decision on a 2020 card is real.

Do I need a GPU?

No. The CPU takes around 300 ms per decision instead of ~57, which still plays: press - to slow the game down.

Does anything leave my machine?

No. The server listens on 127.0.0.1 only, the model runs locally, and your recorded attacks stay in the attacks/ folder.

Where does the idea come from?

From the Snake demo mizorewww built for Laya on Apple Silicon, which we ported to NVIDIA and CPU as laya-snake-cuda. That one shows how fast a typed decision is. This one asks whether it's any good.

Who maintains it?

Nobody, on purpose. Published as is, MIT: fork it and make it yours.

Então o Laya é ruim?

Não é isso que o teste mostra. Ele mostra que sob pressão, com fato cru e sem dica, uma regra de uma linha ganha dele na triagem. Velocidade nunca foi a pergunta: ~57 ms por decisão numa placa de 2020 é de verdade.

Preciso de placa de vídeo?

Não. No processador são uns 300 ms por decisão em vez de ~57, e ainda dá pra jogar: aperta - pra deixar o jogo mais lento.

Alguma coisa sai da minha máquina?

Não. O servidor só escuta no 127.0.0.1, o modelo roda local e os ataques gravados ficam na pasta attacks/.

De onde veio a ideia?

Do demo da cobrinha que o mizorewww fez pro Laya no Apple Silicon, que a gente portou pra NVIDIA e CPU no laya-snake-cuda. Aquele mostra quão rápida é uma decisão tipada. Este pergunta se ela presta.

Quem mantém?

Ninguém, de propósito. Publicado como está, MIT: faz um fork e deixa com a sua cara.