SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.22535 · NeurIPS · 2025

RiverMamba: A State Space Model for Global River Discharge and Flood Forecasting

Mohamad Hakam, Shams Eddin, Juergen Gall, Yikui Zhang, Stefan Kollet

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-24; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2505.22535.json · badge: /api/ran/2505.22535.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
jakubcerveny/gilbert canonical (classifier label)
classifier basis not recorded on the link
9 ran · 1 no recorded run
FunctionStatusWhere it lives
gilbert_d2xy Ran
ran on a synthesized input
jakubcerveny/gilbert/gilbert_d2xy.py
code served (permissive licence) · get_code("7b35a48f7ddaaf38")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Setup code for gilbert_d2xy function

# The function gilbert_d2xy computes 2D coordinates from a position along a
# generalized Hilbert (gilbert) space-filling curve for rectangular grids.
# It takes:
# - idx: position along the curve (integer)
# - w: width of the grid (integer)
# - h: height of the grid (integer)
# and returns (x, y) coordinates

ARGS = {
    "idx": 5,
    "w": 8,
    "h": 6
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gilbert_d2xy_r Ran
ran on a synthesized input
jakubcerveny/gilbert/gilbert_d2xy.py
code served (permissive licence) · get_code("6992ea128d189567")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# This function implements the Gilbert curve (2D Hilbert-like space-filling curve)
# It recursively maps a 1D index to 2D coordinates
# All parameters are integers used in recursive geometric calculations

ARGS = {
    "dst_idx": 42,           # destination index to convert to coordinates
    "cur_idx": 0,            # current index in recursion
    "x": 0,                  # current x coordinate
    "y": 0,                  # current y coordinate
    "ax": 64,                # x component of first basis vector
    "ay": 0,                 # y component of first basis vector
    "bx": 0,                 # x component of second basis vector
    "by": 64,                # y component of second basis vector
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gilbert_d2xyz Ran
ran on a synthesized input
jakubcerveny/gilbert/gilbert_d2xyz.py
code served (permissive licence) · get_code("50720ae3544ff075")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Looking at the function signature, I need to find where it's defined
# The function signature appears to be cut off, but based on the recursive function
# gilbert_d2xyz_r, I can infer what gilbert_d2xyz likely expects

# The function gilbert_d2xyz_r takes:
# - dst_idx: destination index (int)
# - cur_idx: current index (int)
# - x, y, z: current coordinates (int)
# - ax, ay, az: basis vector a (int)
# - bx, by, bz: basis vector b (int)
# - cx, cy, cz: basis vector c (int)

# gilbert_d2xyz likely wraps this and takes idx, width, height, depth
# and initializes the recursion

ARGS = {
    'idx': 5,
    'width': 8,
    'height': 8,
    'depth': 8,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gilbert_d2xyz_r Ran
ran on a synthesized input
jakubcerveny/gilbert/gilbert_d2xyz.py
code served (permissive licence) · get_code("3c32c223b76a11d7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Analyzing the function signature and body to construct valid arguments

# This function implements a recursive 3D Gilbert curve (space-filling curve) algorithm
# It takes:
# - dst_idx, cur_idx: integer indices for recursion tracking
# - x, y, z: current position coordinates (integers)
# - ax, ay, az, bx, by, bz, cx, cy, cz: vector components defining the curve (integers)

# All parameters are used as integers in arithmetic operations
# No complex objects, models, or special methods are called

ARGS = {
    'dst_idx': 5,
    'cur_idx': 0,
    'x': 0,
    'y': 0,
    'z': 0,
    'ax': 4,
    'ay': 0,
    'az': 0,
    'bx': 0,
    'by': 4,
    'bz': 0,
    'cx': 0,
    'cy': 0,
    'cz': 4
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gilbert_xy2d Ran
ran on a synthesized input
jakubcerveny/gilbert/gilbert_xy2d.py
code served (permissive licence) · get_code("161645b6f858278b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# This function maps 2D coordinates to indices on a Gilbert (generalized Hilbert) space-filling curve
# It takes x, y coordinates and grid dimensions w, h

# Simple test cases for the gilbert_xy2d function
# The function expects:
# - x: x-coordinate (integer)
# - y: y-coordinate (integer)
# - w: width of the grid (integer)
# - h: height of the grid (integer)

ARGS = {
    "x": 2,
    "y": 3,
    "w": 8,
    "h": 8,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
in_bounds Ran
ran on a synthesized input
jakubcerveny/gilbert/gilbert_xy2d.py
code served (permissive licence) · get_code("d7f80263f7f5dc85")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - x, y: appear to be numeric values (compared with <, >, <=, >=)
# - x_s, y_s: appear to be numeric values (used in arithmetic and comparisons)
# - ax, ay, bx, by: appear to be numeric values (used in arithmetic and comparisons)
# The function performs bounds checking with rectangular regions

# Simple numeric values that will satisfy the logic
x = 5.0
y = 3.0
x_s = 0.0
y_s = 0.0
ax = 10.0
ay = 8.0
bx = 2.0
by = 1.0

ARGS = {
    "x": x,
    "y": y,
    "x_s": x_s,
    "y_s": y_s,
    "ax": ax,
    "ay": ay,
    "bx": bx,
    "by": by
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sgn Ran
ran, honoured the contract we drafted
jakubcerveny/gilbert/gilbert_d2xy.py
code served (permissive licence) · get_code("441e92cd07dd8324")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

ARGS = {
    "x": 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
v_delta Ran
ran on a synthesized input
jakubcerveny/gilbert/extensions/gilbert3dpp.py
code served (permissive licence) · get_code("591561a3cb480b28")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

def sgn(t):
    return 1 if t > 0 else -1 if t < 0 else 0

def v_delta(v):
    return list(map(lambda t: sgn(t), v))

# Construct valid arguments for v_delta
# v_delta expects a single parameter 'v' which is an iterable of numeric values
# The function applies sgn to each element, so v should be a list or similar iterable

torch.manual_seed(0)

# Create a simple list of numeric values (mix of positive, negative, and zero)
v = [2.5, -1.3, 0, 4.2, -3.1, 0.0]

ARGS = {
    "v": v
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
v_divq Ran
ran on a synthesized input
jakubcerveny/gilbert/extensions/gilbert3dpp.py
code served (permissive licence) · get_code("290b345ac4fb0b24")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# v_divq takes two parameters: v and q
# It maps over v, dividing each element by q and converting to int
# So v should be an iterable of numeric values
# q should be a numeric divisor

ARGS = {
    "v": [10, 20, 30, 40],
    "q": 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gilbert_xyz2d Not yet run
unverified (harvested, no recorded run)
jakubcerveny/gilbert/gilbert_xyz2d.py
code served (permissive licence) · get_code("80e731412ab11e9f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
sgn 2 other papers
1 dated earlier, 1 later
2407.21773 (2024-07)
RainMamba: Enhanced Locality Learning with State Space Models for Video Deraining
2511.05832 (2025-11)
Hilbert-Guided Sparse Local Attention

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Recent deep learning approaches for river discharge forecasting have improved the accuracy and efficiency in flood forecasting, enabling more reliable early warning systems for risk management. Nevertheless, existing deep learning approaches in hydrology remain largely confined to local-scale applications and do not leverage the inherent spatial connections of bodies of water. Thus, there is a strong need for new deep learning methodologies that are capable of modeling spatio-temporal relations to improve river discharge and flood forecasting for scientific and operational applications. To address this, we present RiverMamba, a novel deep learning model that is pretrained with long-term reanalysis data and that can forecast global river discharge and floods on a 0.05 • grid up to 7 days lead time, which is of high relevance in early warning. To achieve this, RiverMamba leverages efficient Mamba blocks that enable the model to capture spatio-temporal relations in very large river networks and enhance its forecast capability for longer lead times. The forecast blocks integrate ECMWF HRES meteorological forecasts, while accounting for their inaccuracies through spatio-temporal modeling. Our analysis demonstrates that RiverMamba provides reliable predictions of river discharge across various flood return periods, including extreme floods, and lead times, surpassing both AIand physics-based models. The source code and datasets are publicly available at the project page https://hakamshams.github.io/RiverMamba.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2505.22535")
get_code_for_paper("2505.22535")
have("2505.22535")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2505.22535.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2505.22535.svg)](https://syntology.ai/paper/2505.22535)

Connect an agent — have() is free.