frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: ShapeGuard – Shape Contracts for NumPy and Jax

1•jayendra13•2h ago

  I built ShapeGuard because shape errors in numerical code are uniquely painful. They're silent (wrong shapes often produce garbage instead of crashing), late (errors surface deep in XLA,
   not where the bug is), and cryptic (shapes (3,4) and (5,3) not aligned — but why should they match?).

  ShapeGuard lets you declare shape contracts on functions using symbolic dimensions:

  from shapeguard import Dim, expects, ensures

  n, m, k = Dim("n"), Dim("m"), Dim("k")

  @expects(a=(n, m), b=(m, k))
  @ensures(result=(n, k))
  def matmul(a, b):
      return a @ b

  When shapes don't match, the error traces bindings back to their source:

  ShapeGuardError:
    function: matmul
    argument: b
    expected: (m, k)
    actual:   (5, 7)
    reason:   dimension 'm' bound to 4 from a.shape[1], but got 5 from b.shape[0]
    bindings: {n=3 (from a[0]), m=4 (from a[1])}

  The key idea is unification — the same Dim object used across arguments must resolve to the same integer. ShapeGuard tracks where each binding came from, so conflicts pinpoint the exact
  source.

  What it does:

  - @expects / @ensures / @contract — input and output shape validation
  - Symbolic Dim with cross-argument unification
  - Batch() dims and ... ellipsis for ML patterns
  - broadcast_shape() and explain_broadcast() for debugging broadcasting
  - Configurable JIT modes (check / warn / skip) for JAX
  - ML helpers: pre-defined dims (B, T, C, H, W, D), attention_shapes(), conv_output_shape()

  What it doesn't do:

  - No dtype checking (jaxtyping does this well)
  - No named-tensor wrapper (Haliax's approach)
  - Not a replacement for static type checking

  It's zero-dependency, drop-in (works with existing code — just add decorators), and the motivation came from analyzing 40 real JAX GitHub issues where users hit cryptic shape errors.

  PyPI: pip install jax-shapeguard

  Would love feedback on the API design, error message format, and whether this would actually help your workflow. What shape debugging pain points am I missing?

Gemini 3 Flash Preview: Inconsistent thought_signature

https://discuss.ai.google.dev/t/gemini-3-flash-preview-inconsistent-thought-signature-generation-...
1•tosh•1m ago•0 comments

To Fight a Troll

https://blog.zarfhome.com/2026/02/to-fight-a-troll
1•tobr•4m ago•0 comments

Cola Holy Grail: Great taste, no calories, no sweetener

https://www.seattletimes.com/seattle-news/health/cola-holy-grail-great-taste-no-calories-no-artif...
1•gsf_emergency_6•8m ago•0 comments

A Complete Guide to Neural Network Optimizers

https://chizkidd.github.io//2026/01/22/neural-net-optimizers/
1•chizkidd•9m ago•0 comments

Adding Support for Qwen3.5

https://github.com/huggingface/transformers/pull/43830
1•limoce•12m ago•0 comments

Show HN: Logifai – Auto-capture dev logs for AI coding assistants

https://github.com/tomoyaf/logifai
1•TomoyaFujita•13m ago•0 comments

LocalLLMJournal – An offline, privacy-first AI journal running locally on macOS

https://github.com/superS007/localllmjournal
2•sourav_sen_duke•16m ago•0 comments

India has changed its tech startup rules

https://techcrunch.com/2026/02/07/india-has-changed-its-startup-rules-for-deep-tech/
2•rippeltippel•20m ago•1 comments

Syd: Writing an application kernel in Rust [video]

https://fosdem.org/2026/schedule/event/3AHJPR-rust-syd-application-kernel/
2•hayali•23m ago•0 comments

Containers, cloud, blockchain, AI – all the same old BS, says veteran Red Hatter

https://www.theregister.com/2026/02/08/waves_of_tech_bs/
2•Brajeshwar•26m ago•0 comments

Show HN: Terminal txt novel reader support bookmark and pagination

2•cc-magus•30m ago•0 comments

SHOW HN: Postman removes free team collaboration (small teams capped at 1 user)

2•themast•33m ago•1 comments

Beyond VDI: The rise of the 1:1 remote workstation

https://aecmag.com/features/the-rise-of-the-11-remote-workstation/
2•transpute•34m ago•0 comments

Show HN: Give Your AI the Ability to Find, Install, and Use Skill Autonomously

2•twwch•37m ago•0 comments

Who Approved This Agent? A book on authorizing AI-generated code

2•humanatsetc•38m ago•0 comments

Building the last peace of handware glovable.dev

https://glovable.dev
1•rommin•40m ago•0 comments

Show HN: Safeoid – Turn Messy PDFs into Structured Excel, CSV, or JSON

https://safeoid.com/
1•edukid•46m ago•1 comments

Comic Code Reviews, Part 2

http://www.jona.ca/2026/02/comic-code-reviews-part-2.html
1•JonathanAquino•53m ago•1 comments

Show HN: EdgeAI-OS – Air-gapped Linux distro where AI is a system primitive

1•neuralweaves•54m ago•0 comments

Ask HN: Since when got my computer their cloud node (agent)

1•rumpelstiel•54m ago•0 comments

Show HN: Agentseed – Generate Agents.md from a Codebase

https://github.com/avinshe/agentseed
1•avinshe•56m ago•0 comments

Big Tech groups race to fund unprecedented $660B AI spending spree

https://www.ft.com/content/d503afd5-1012-40f0-8f9d-620dcb39a9a2
3•petethomas•57m ago•0 comments

Show HN: Klint – Linux Kernel Security Scanner

http://saturnine.cc/klint/
1•h2337•1h ago•0 comments

Field Notes from a Senior Living Center

https://substack.com/@beccaselah/p-181168438
2•bkudria•1h ago•0 comments

America's Most Valuable Companies 1995-2023

https://americanbusinesshistory.org/americas-most-valuable-companies-1995-2023/
2•js2•1h ago•0 comments

Private 4G LTE Network for Your Embedded System and IoT Hacking Lab via Open5GS

https://gainsec.com/2025/10/08/setting-up-your-own-4g-lte-network-150-for-your-embedded-system-io...
2•teleforce•1h ago•1 comments

Nobody knows how the whole system works

https://surfingcomplexity.blog/2026/02/08/nobody-knows-how-the-whole-system-works/
11•azhenley•1h ago•4 comments

O_DIRECT – The Problem That Grew Up with Multi-Threading

https://zazolabs.com/odirect-the-problem-that-grew-up/
1•GalaxySnail•1h ago•0 comments

Show HN: Valk programming language with a stateful GC

https://github.com/valk-lang/valk
1•ctxcode•1h ago•0 comments

Setting Up and Configuring LibreSDR B210/B220 AD9361 on Windows and Linux (2025)

https://gainsec.com/2025/01/23/setting-up-and-configuring-libresdr-b210-b220-ad9361-on-windows-an...
1•teleforce•1h ago•0 comments