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
| What | Limit or size | Source |
|---|---|---|
Int | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (64 bits); going past it panics | 01-built-in-types.md |
Int8, Int16, Int32 | -128 to 127; -32,768 to 32,767; -2,147,483,648 to 2,147,483,647 | 01-built-in-types.md |
UInt8, UInt16, UInt32, UInt64 | 0 to 255; 0 to 65,535; 0 to 4,294,967,295; 0 to 18,446,744,073,709,551,615 | 01-built-in-types.md |
Float | 64 bits: about 15 to 17 significant digits, up to about 1.8e308 | 01-built-in-types.md |
Float32 | 32 bits: about 7 significant digits, up to about 3.4e38 | 01-built-in-types.md |
Decimal | no 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 point | 01-built-in-types.md |
BigInt | no limit: as many digits as the number needs | 01-built-in-types.md |
Explained on Data Types
Text
| What | Limit or size | Source |
|---|---|---|
String | UTF-8 text, as long as memory allows; it can't be changed in place | 01-built-in-types.md |
s.len() | counts characters, not bytes: "नमस्ते".len() is 6 | 02-built-in-methods.md |
Char | one Unicode character: code points 0 to 0x10FFFF, surrogates excluded | 01-built-in-types.md |
Explained on Strings
Lists
| What | Limit or size | Source |
|---|---|---|
[UInt8], [Int8], [Bool] | 1 byte per item | 0030-byte-packed-lists.md |
[Int16], [UInt16]; [Int32], [UInt32], [Float32] | 2 bytes; 4 bytes per item | 0045-packed-lists-of-small-numbers.md |
Other items | 8 bytes per item: a 64-bit number, or a reference to a bigger value. Packing is in native code; the interpreter keeps its own values | 0045-packed-lists-of-small-numbers.md |
Explained on Lists
Tasks and channels
| What | Limit or size | Source |
|---|---|---|
Channel capacity | 1 or more; put waits while the channel is full | 09-concurrency.md |
A task's stack | 512 MB of address space each, used only as calls need it | lib.rs |
Explained on Channels
Network
| What | Limit or size | Source |
|---|---|---|
Any network wait (not accept or receive) | gives up after 30 seconds, with TimedOut; .timeout(d) changes it | 10-net.md |
conn.read() | at most 64 KB at a time | 10-net.md |
A UDP datagram | at most 64 KB is read | 10-net.md |
An HTTP server's idle connection | closed after 5 seconds without a request | 11-http.md |
Explained on Sockets
JSON
| What | Limit or size | Source |
|---|---|---|
Nesting | 128 levels deep; max_depth raises it, up to 10,000 | 12-json.md |
Text | 64 MB; max_bytes raises it | 12-json.md |
Fields in one object | 100,000; max_fields raises it | 12-json.md |
A number's exponent | from 10^-10,000 to 10^10,000, for decimal() and bigint() | 12-json.md |
Explained on JSON
Random numbers
| What | Limit or size | Source |
|---|---|---|
random.bytes(n) | n from 0 to 65,536 per call | 15-random.md |
Explained on Random Numbers
Logging
| What | Limit or size | Source |
|---|---|---|
A log file | a new file after 10 MB (max_bytes); 5 older ones kept (keep) | 12-log.md |
Events waiting for an OpenTelemetry collector | up to 10,000, sent at least once a second; at exit, up to 2 seconds to send the rest | 12-log.md |
Explained on Logging
AI calls
| What | Limit or size | Source |
|---|---|---|
The model | claude-haiku-5-5, unless the agent (model) or the call (model:) chooses one | 04-typed-ai-calls.md |
An answer's length | 4,096 tokens, reasoning included; a Model's max_tokens changes it | 04-typed-ai-calls.md |
An answer that doesn't fit the type | asked again 2 times, then InvalidOutput | 04-typed-ai-calls.md |
Explained on ask<T>
GPU
| What | Limit or size | Source |
|---|---|---|
Values in a gpu fn | Float32, Int32, UInt32 and Bool only | 15-gpu.md |
A record or tuple item | 1 to 8 fields of those types | 15-gpu.md |
Explained on GPU: gpu fn
Files and functions
| What | Limit or size | Source |
|---|---|---|
A .kav file | 500 lines, counting every line: an error by default | 12-maintainability.md |
A function body | 80 lines: a warning | 12-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.