Skip to main content

Your code lands. Every time. Crash prevention for Python built on Integer Descent Logic.

Project description

SoftLand

Your code lands. Every time.


pip install softland

The Problem

Python crashes under pressure. Stack overflows. Recursion limits. Memory walls. Your function hits a ceiling mid-execution and throws — taking your data, your state, and your user's request down with it.

This is not a Python bug. It is a physics problem.

When information pressure exceeds the container, the container breaks.


The Solution — Integer Descent Logic

SoftLand treats computation like fluid pressure.

Every recursive function has a bit-weight — a measure of how much state it is carrying at any given depth. As that weight approaches the system ceiling, SoftLand detects the pressure spike and descends: it mutates the execution from recursive to iterative mid-flight, carries the current state across the transition, and completes the computation without a single lost value.

The function does not crash. It lands.

Without SoftLand:              With SoftLand:
──────────────────             ─────────────────────────────
process(n=50000)               process(n=50000)
  → depth 298                    → depth 298
  → depth 299                    → depth 299
  → depth 300                    → [SOFTLAND] pressure detected
  → RecursionError 💥            → descending to iterative mode
  → data lost                    → landed ✓
  → user sees 500 error          → result returned. 0 errors.

Quickstart

import softland

@softland.watch
def sum_recursive(n, acc=0):
    if n == 0:
        return acc
    return sum_recursive(n - 1, acc + n)

# This would normally crash at ~1000 depth.
# With SoftLand it runs clean on any input.
result = sum_recursive(100000)
print(result)  # 5000050000

That is the entire integration. One decorator.


With API Key — Dashboard Reporting

Connect to your SoftLand dashboard to see every descent event logged in real time: which function, what depth, how long recovery took.

import softland

softland.configure(
    api_key="sk_live_your_key_here",
    threshold=300,   # stack depth that triggers descent
    verbose=True     # print descent events to console
)

@softland.watch
def process_data(n, acc=0):
    if n == 0:
        return acc
    return process_data(n - 1, acc + n)

result = process_data(500000)
# [SOFTLAND] process_data — pressure at depth 300. Descending...
# [SOFTLAND] process_data — landed clean. Mode: safe_mode_descent (41.2ms)

Get your API key at https://soft-land-safe.base44.app


Custom Iterative Fallback — Maximum Control

For full precision, define exactly how the iterative phase should run:

import softland

# Define your iterative version
def _sum_iterative(n, acc=0):
    while n > 0:
        acc += n
        n -= 1
    return acc

# Attach it to the recursive version
@softland.watch
def sum_recursive(n, acc=0):
    if n == 0:
        return acc
    return sum_recursive(n - 1, acc + n)

sum_recursive.__softland_iterate__ = _sum_iterative

# SoftLand now uses your iterative path during descent.
# Result is guaranteed identical to the recursive path.
result = sum_recursive(100000)

Configuration Reference

softland.configure(
    api_key="sk_live_...",   # Your SoftLand dashboard API key
    threshold=300,            # Stack depth that triggers descent (default: 300)
    verbose=False,            # Print descent events to console (default: False)
)
@softland.watch(
    threshold=500,            # Override global threshold for this function
    verbose=True              # Override global verbose for this function
)
def my_function(n):
    ...

How the Descent Works

  1. Pressure Monitor — Every recursive call increments a depth counter.
  2. Threshold Check — When depth hits the configured limit, a _DescentSignal is raised internally. This is not an error. It is a controlled parachute pull.
  3. State Capture — The signal carries the current arguments — the exact mid-flight state — forward to the iterative phase.
  4. Iterative Execution — If you defined __softland_iterate__, it runs that. Otherwise SoftLand uses safe-mode execution to complete the remaining work.
  5. Landing — The result is returned to the original caller as if nothing happened. Bit-level integrity. Zero data loss.

Safety Guarantees

  • Zero dependencies. SoftLand uses only the Python standard library.
  • Non-blocking reporting. Dashboard events fire in a daemon thread with a hard 1-second timeout. If the SoftLand backend is unreachable, your app continues running. The reporter disappears silently.
  • Non-invasive. SoftLand patches your function temporarily during execution and always restores the original reference in a finally block.
  • No source code transmitted. Only metadata is reported: function name, stack depth, mode, duration. Your code and your data never leave your machine.

The Numbers

These results were verified in live testing on consumer hardware:

Test Result
Generator size after 50M iterations 232 bytes — zero growth
Memory vs list approach 238,000x less RAM
Descent trigger accuracy 100% — no false positives
Data integrity after recovery SHA-256 verified — zero loss
Survival under concurrent memory attack 100% (2M/2M iterations)

License

MIT — use it, build on it, ship it.


Dashboard

https://soft-land-safe.base44.app

Real-time logs. Descent analytics. API key management. See every pressure event your production app survives.


Built on Integer Descent Logic. The Elephant has been replaced by the Ant.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

softland-0.0.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

softland-0.0.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file softland-0.0.1.tar.gz.

File metadata

  • Download URL: softland-0.0.1.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for softland-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c08b5b7dde7fb01ad03281c9bf4456a16c54d53dc8e0bba0f9142e32f08b592c
MD5 9a8a03e6a39af8382bb1355bc7fe37c7
BLAKE2b-256 515756bd4031346a8564f4341dd4a9eb732153a7b189cef11fcb4968b5459e6e

See more details on using hashes here.

File details

Details for the file softland-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: softland-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for softland-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ef5fe76ae2971669b3148ac3ff486138847131148ecb05e534cebe4e93ec54e
MD5 d3e03280965bde7f862435263a72a3a3
BLAKE2b-256 b01f1df780ca15738699550161e88946c0a688f837ccd94da8f44bfc525caf36

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page