Technical Details (flowlog.c)

This document describes the runtime model of Flowlog as built from flowlog.c. It is intended for developers and performance work.

Code references (section markers in flowlog.c):

Process model

Threads and scheduling (high level)

Flowlog has one OS process and may create pthread workers when (SECTIONS 07/21):

Thread usage is intentionally bounded (SECTION 01 and SECTION 07):

CPU and memory auto-configuration

CPU count

Flowlog:

Stack sizing

OR-par workers execute deep recursive solver code. To avoid stack overflows while also staying safe on high-core machines, Flowlog (SUBSECTION 04.3):

Some systems also default to a small main thread stack (for example, Linux often defaults to 8 MiB). When the interpreter engine runs deep recursive goals (notably --engine tree), this can overflow the main stack. Flowlog can optionally run its main loop on a dedicated pthread with a larger stack when RLIMIT_STACK is small; see FLOWLOG_STACK_BOOST and FLOWLOG_MAIN_STACK_SIZE in CLI.md (SUBSECTION 26.3).

Memory strategy

Flowlog’s core solver allocates many short-lived objects (terms, environments, temporary vectors) (SECTION 09).

This build uses:

Tuning:

Signals and interactive control

When running in the TTY REPL (SUBSECTION 04.3 and SECTION 26):

When not a TTY (piped input), Ctrl-C/Ctrl-T behavior depends on your shell/terminal and may not be delivered to Flowlog.

I/O and streams

Flowlog uses process-local FILE* streams and implements the ISO stream predicates directly (SECTION 08 and SUBSECTION 17.5).

REPL note:

Output and error reporting

Flowlog prints results in a test-friendly format (SECTION 17):

For scripting, treat stdout as the primary “transcript” stream.

Debugging OR-parallelism

Environment variables:

These logs are intended to help identify: