Skip to content
Kavachकवच

Limits and Sizes

Also known as: limits sizes maximum minimum range max int overflow stack size depth timeout capacity bytes how big how many

● Intermediate5 min

Every limit and size in Kavach in one place: number ranges, text, lists, tasks, the network, JSON, AI calls, the GPU and files, each linked to the page that explains it.

Each table is the same one its topic's page shows, from one list, so the two always agree.

Numbers

WhatLimit or sizeSource
Int-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (64 bits); going past it panics01-built-in-types.md
Int8, Int16, Int32-128 to 127; -32,768 to 32,767; -2,147,483,648 to 2,147,483,64701-built-in-types.md
UInt8, UInt16, UInt32, UInt640 to 255; 0 to 65,535; 0 to 4,294,967,295; 0 to 18,446,744,073,709,551,61501-built-in-types.md
Float64 bits: about 15 to 17 significant digits, up to about 1.8e30801-built-in-types.md
Float3232 bits: about 7 significant digits, up to about 3.4e3801-built-in-types.md
Decimalno limit: up to about 38 digits in a fast 128-bit form, more in a bigger one; a division that doesn't end keeps 18 digits after the point01-built-in-types.md
BigIntno limit: as many digits as the number needs01-built-in-types.md

Explained on Data Types

Text

WhatLimit or sizeSource
StringUTF-8 text, as long as memory allows; it can't be changed in place01-built-in-types.md
s.len()counts characters, not bytes: "नमस्ते".len() is 602-built-in-methods.md
Charone Unicode character: code points 0 to 0x10FFFF, surrogates excluded01-built-in-types.md

Explained on Strings

Lists

WhatLimit or sizeSource
[UInt8], [Int8], [Bool]1 byte per item0030-byte-packed-lists.md
[Int16], [UInt16]; [Int32], [UInt32], [Float32]2 bytes; 4 bytes per item0045-packed-lists-of-small-numbers.md
Other items8 bytes per item: a 64-bit number, or a reference to a bigger value. Packing is in native code; the interpreter keeps its own values0045-packed-lists-of-small-numbers.md

Explained on Lists

Tasks and channels

WhatLimit or sizeSource
Channel capacity1 or more; put waits while the channel is full09-concurrency.md
A task's stack512 MB of address space each, used only as calls need itlib.rs

Explained on Channels

Network

WhatLimit or sizeSource
Any network wait (not accept or receive)gives up after 30 seconds, with TimedOut; .timeout(d) changes it10-net.md
conn.read()at most 64 KB at a time10-net.md
A UDP datagramat most 64 KB is read10-net.md
An HTTP server's idle connectionclosed after 5 seconds without a request11-http.md

Explained on Sockets

JSON

WhatLimit or sizeSource
Nesting128 levels deep; max_depth raises it, up to 10,00012-json.md
Text64 MB; max_bytes raises it12-json.md
Fields in one object100,000; max_fields raises it12-json.md
A number's exponentfrom 10^-10,000 to 10^10,000, for decimal() and bigint()12-json.md

Explained on JSON

Random numbers

WhatLimit or sizeSource
random.bytes(n)n from 0 to 65,536 per call15-random.md

Explained on Random Numbers

Logging

WhatLimit or sizeSource
A log filea new file after 10 MB (max_bytes); 5 older ones kept (keep)12-log.md
Events waiting for an OpenTelemetry collectorup to 10,000, sent at least once a second; at exit, up to 2 seconds to send the rest12-log.md

Explained on Logging

AI calls

WhatLimit or sizeSource
The modelclaude-haiku-5-5, unless the agent (model) or the call (model:) chooses one04-typed-ai-calls.md
An answer's length4,096 tokens, reasoning included; a Model's max_tokens changes it04-typed-ai-calls.md
An answer that doesn't fit the typeasked again 2 times, then InvalidOutput04-typed-ai-calls.md

Explained on ask<T>

GPU

WhatLimit or sizeSource
Values in a gpu fnFloat32, Int32, UInt32 and Bool only15-gpu.md
A record or tuple item1 to 8 fields of those types15-gpu.md

Explained on GPU: gpu fn

Files and functions

WhatLimit or sizeSource
A .kav file500 lines, counting every line: an error by default12-maintainability.md
A function body80 lines: a warning12-maintainability.md

Explained on Small Files

Recursion

How deep a function can call itself depends on where it runs: see the table on Recursion.

Limits that a setting can change, such as the file length, are listed with their settings on Settings.