Skip to main content

winnex-nano-math

Representação estrutural para inferência geométrica.

Preserva composição e ordem — as duas coisas que a assinatura de bytes descarta antes de qualquer geometria acontecer.

O problema

O tokenizador de bytes da stack produz v = Σ_k B[b_k], que é comutativo por construção. a+b*c e (a+b)*c têm a mesma massa de bytes, o mesmo vetor, e nenhum índice pode desfazer isso.

Medido: recuperação do token indexado chega a 100% em top-10, mas generalização para frase livre é 0,0/10. A stack devolve massa de bytes parecida. Não é falha da geometria — é a natureza da representação de entrada.

O que faz

texto → lexer → parser → AST → normalização canônica
      → codificação estrutural não-comutativa → vetor
camada o que garante
lexer cada unidade tem TIPO (variável, literal, operador)
parser árvore com ordem e aridade — (a+b)*c ≠ a+b*c
normalize x²+y²=z² ≡ x**2 + y**2 == z**2; alfa-renomeação
encode composição por posição na ÁRVORE (rotação áurea, isometria)
equivalencia igualdade estrutural e proximidade, declaradas separadas

Estrutura do repositório

src/winnex_nano_math/   o pacote publicável
tests/                  bateria automatizada (48 testes, CI)
experimentos/           scripts de medição — NÃO são testes
resultados/             saída dos experimentos, versionada como evidência
docs/                   notas de correção e análise

experimentos/ e resultados/ ficam separados de src/ de propósito: são caderno de laboratório, não biblioteca. Rodam em minutos e dependem de um modelo local; o pacote não depende deles.

Instalação

pip install winnex-nano-math

Uso

import winnex_nano_math as nm

# formas diferentes, mesma árvore
nm.mesma_forma("x^2 + y^2 = z^2", "x**2 + y**2 == z**2")   # True

# estruturas diferentes continuam diferentes
nm.cosseno("(a + b) * c", "a + b * c")                      # < 0.9

# comutativos colapsam; não-comutativos não
nm.mesma_forma("x + y", "y + x")                            # True
nm.mesma_forma("x - y", "y - x")                            # False

# alfa-equivalência
nm.alfa_equivalente("lambda x : x", "lambda y : y")         # True

# vetor pronto para o Madhava
v = nm.codifica("a + b * c")                                # shape (256,)

Atenção esparsa certificada

winnex_nano_math.atencao implementa poda de atenção por bound de Cauchy-Schwarz, separando duas coisas que não são a mesma:

  • seleção — S = {i : ub_i ≥ τ} escolhe quais k tokens entram na ponderação. Heurística.
  • certificado — ub_i < η, com η o k-ésimo maior lower bound, prova que i não está no top-k. Verificável: tests/test_atencao.py.

Números em Qwen2.5-0.5B, camada 0, base PCA alinhada rank 15/64:

k descartado provado
4 49,5% 5,3%
8 16,2% 0,4%
16 0,0% 0,0%

Onde não perde qualidade (k ≥ 16), não descarta nada. Onde descarta (k=4), perde qualidade e prova pouco. O certificado real é bem menor que o reportado em v0.2.3 — ver docs/ATENCAO_ESPARSA_CORRECAO.md.

Testes

pytest          # 48 testes; o pytest.ini já põe src/ no path

O que este pacote NÃO faz

  • Não faz álgebra simbólica. x+x e 2*x ficam próximos, não idênticos.
  • Não modela probabilidade condicional — não é um modelo de linguagem.
  • Não tem resultado publicado. É uma hipótese com testes falsificáveis.

Testes

pip install -e ".[test]"
pytest tests/ -v

Cada teste declara no docstring o que o falsificaria. A bateria inclui um teste anti-trapaça: entradas diferentes têm de produzir saídas diferentes. Foi esse teste que revelou que cinco versões publicadas do motor devolviam o mesmo top-k para qualquer consulta.

Status

Hipótese em avaliação. O critério de sucesso não é "F3 > 0" — 0,4/10 é o mesmo fracasso com outro nome. O alvo é generalização comparável à recuperação. Se a representação só recupera a si mesma, herdou o defeito atual com mais passos.

Licença

BSL 1.1 — Winnex Brasil Soluções Empresariais LTDA-ME

Metadata

Release files for winnex-nano-math 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for winnex-nano-math 0.2.4
File Size Uploaded Provenance Actions
winnex_nano_math-0.2.4.tar.gz 30.6 kB With provenance Details for winnex_nano_math-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for winnex-nano-math 0.2.4
File Interpreter ABI Platform Actions
winnex_nano_math-0.2.4-py3-none-any.whl Python 3 none any Details for winnex_nano_math-0.2.4-py3-none-any.whl

Total release size: 56.2 kB

Release files / winnex_nano_math-0.2.4.tar.gz

Download URL winnex_nano_math-0.2.4.tar.gz
Size 30.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a9e3586e202523fc925ad2f5c563a1851b11a94086113fafb2cb298ab2dae8fd
BLAKE2b-256 checksum
How to use checksums
d4a5d8081f205c8f08f72f2246ce37b241882f8d9320f604594e45f3c0f30990
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / winnex_nano_math-0.2.4-py3-none-any.whl

Download URL winnex_nano_math-0.2.4-py3-none-any.whl
Size 25.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34b0d65c6113bf6a6c746ec2f8f5f80b477c44520668acc8065fd2241791d001
BLAKE2b-256 checksum
How to use checksums
036ef3447f99451424b9b54d1a24e168e00ec3cd74e5a95fd697f7ca631563f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for winnex-nano-math 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for winnex_nano_math-0.2.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page