# appendFile
function appendFile(path, text)Add state for append file.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | dynamic | — | Filesystem path to process. |
text | dynamic | — | Text to parse or process. |
src/miniquake/compat_trace.mlminiquake/build_info.ml as buildInfo → src/miniquake/build_info.mlminiquake/compat_diagnostics.ml as diagnostics → src/miniquake/compat_diagnostics.mlminiquake/host.ml as host → src/miniquake/host.mlminiquake/native.ml as native → src/miniquake/native.mlminiquake/types.ml as t → src/miniquake/types.mlstd/fs.ml as fs → ../MiniLangCompilerOptimization/MiniLangCompilerPy/std/fs.ml external dependencyfunction appendFile(path, text)Add state for append file.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | dynamic | — | Filesystem path to process. |
text | dynamic | — | Text to parse or process. |
function attemptShutdown(session)Update subsystem state for attempt shutdown.
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `attemptShutdown`. |
function boolNumber(value)Return bool number derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | dynamic | — | Value consumed by `boolNumber`. |
function canonicalFrame(session, frameIndex, accepted)BP-001 originally expressed the complete frame as one deeply nested + tree. The Win64 backend has a bounded expression-temporary area, so keep every canonical field in the same order but append it in compiler-safe statements.
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `canonicalFrame`. |
frameIndex | dynamic | — | Zero-based index of the requested entry. |
accepted | dynamic | — | The accepted input consumed by `canonicalFrame`. |
function clientEntitiesHash(session)cl.entities is intentionally sparse. SV_CreateBaseline omits non-model entities, while CL_EntityNum grows the array with void slots up to the next transmitted entity number. Hash both the slot topology and the populated records without dereferencing void.
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `clientEntitiesHash`. |
function clientEntitiesJson(session)Implements the `clientEntitiesJson` operation for `miniquake.compat_trace` (client entities json).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `clientEntitiesJson`. |
function clientEntityJson(item)Implements the `clientEntityJson` operation for `miniquake.compat_trace` (client entity json).
| Parameter | Type | Default | Description |
|---|---|---|---|
item | dynamic | — | The item input consumed by `clientEntityJson`. |
function containsText(text, needle)Implements the `containsText` operation for `miniquake.compat_trace` (contains text).
| Parameter | Type | Default | Description |
|---|---|---|---|
text | dynamic | — | Text to parse or process. |
needle | dynamic | — | The needle input consumed by `containsText`. |
function edictJson(session, index, item)Implements the `edictJson` operation for `miniquake.compat_trace` (edict json).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `edictJson`. |
index | dynamic | — | Zero-based index of the requested entry. |
item | dynamic | — | The item input consumed by `edictJson`. |
function edictsJson(session)Implements the `edictsJson` operation for `miniquake.compat_trace` (edicts json).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `edictsJson`. |
const FNV_OFFSET = 2166136261Defines the fnv offset value used by `miniquake.compat_trace`.
const FNV_PRIME = 16777619Defines the fnv prime value used by `miniquake.compat_trace`.
function globalsHash(session)Implements the `globalsHash` operation for `miniquake.compat_trace` (globals hash).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `globalsHash`. |
inline function hashByte(state, value)Returns whether `miniquake.compat_trace` has h byte.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.compat_trace` state used by `hashByte`. |
value | dynamic | — | Value consumed by `hashByte`. |
function hashFloat(state, value)Fold float into the deterministic rolling hash.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.compat_trace` state used by `hashFloat`. |
value | dynamic | — | Value consumed by `hashFloat`. |
function hashSizeBuffer(state, buffer)Fold size buffer into the deterministic rolling hash.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.compat_trace` state used by `hashSizeBuffer`. |
buffer | dynamic | — | The buffer input consumed by `hashSizeBuffer`. |
function hashText(text)Fold text into the deterministic rolling hash.
| Parameter | Type | Default | Description |
|---|---|---|---|
text | dynamic | — | Text to parse or process. |
function hashTextSeed(state, text)Fold text seed into the deterministic rolling hash.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.compat_trace` state used by `hashTextSeed`. |
text | dynamic | — | Text to parse or process. |
function hashVec3(state, value, label)Hash a Vec3 without keeping a heap object only inside a nested call expression. This is deliberately allocation-free after the type check.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.compat_trace` state used by `hashVec3`. |
value | dynamic | — | Value consumed by `hashVec3`. |
label | dynamic | — | The label input consumed by `hashVec3`. |
function hashWord(state, value)Fold word into the deterministic rolling hash.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.compat_trace` state used by `hashWord`. |
value | dynamic | — | Value consumed by `hashWord`. |
function hashWordArray(words)Fold word array into the deterministic rolling hash.
| Parameter | Type | Default | Description |
|---|---|---|---|
words | dynamic | — | The words input consumed by `hashWordArray`. |
function inspect(path)Implements the `inspect` operation for `miniquake.compat_trace` (inspect).
| Parameter | Type | Default | Description |
|---|---|---|---|
path | dynamic | — | Filesystem path to process. |
function lineCount(text)Return line count derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
text | dynamic | — | Text to parse or process. |
function makeResult(ok, requested, written, accepted, rollingHash, prefix, lastStage, errorText, cleanShutdown)Create and initialize result.
| Parameter | Type | Default | Description |
|---|---|---|---|
ok | dynamic | — | The ok input consumed by `makeResult`. |
requested | dynamic | — | The requested input consumed by `makeResult`. |
written | dynamic | — | The written input consumed by `makeResult`. |
accepted | dynamic | — | The accepted input consumed by `makeResult`. |
rollingHash | dynamic | — | The rolling hash input consumed by `makeResult`. |
prefix | dynamic | — | The prefix input consumed by `makeResult`. |
lastStage | dynamic | — | The last stage input consumed by `makeResult`. |
errorText | dynamic | — | The error text input consumed by `makeResult`. |
cleanShutdown | dynamic | — | The clean shutdown input consumed by `makeResult`. |
function printResult(result)Format and emit result.
| Parameter | Type | Default | Description |
|---|---|---|---|
result | dynamic | — | Result value to report or translate into a status code. |
function protocolHash(session)Implements the `protocolHash` operation for `miniquake.compat_trace` (protocol hash).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `protocolHash`. |
function qcEdictsHash(session)Implements the `qcEdictsHash` operation for `miniquake.compat_trace` (qc edicts hash).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `qcEdictsHash`. |
function qcFunctionIndex(session)Return qc function index derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `qcFunctionIndex`. |
function rawEdictHash(session, index)Implements the `rawEdictHash` operation for `miniquake.compat_trace` (raw edict hash).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `rawEdictHash`. |
index | dynamic | — | Zero-based index of the requested entry. |
function resourceJson(session)Implements the `resourceJson` operation for `miniquake.compat_trace` (resource json).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `resourceJson`. |
function run(baseDirectory, gameDirectory, mapName, frameCount, outputPrefix)No diagnostics-only failure may escape as an unclassified process exit. Convert unexpected propagation into a regular failed result and leave an emergency summary for the black-port feedback loop whenever possible.
| Parameter | Type | Default | Description |
|---|---|---|---|
baseDirectory | dynamic | — | Root directory containing the Quake installation. |
gameDirectory | dynamic | — | Selected Quake game-data directory. |
mapName | dynamic | — | Name of the map to load or inspect. |
frameCount | dynamic | — | Number of entries or units to process. |
outputPrefix | dynamic | — | The output prefix input consumed by `run`. |
function runInternal(baseDirectory, gameDirectory, mapName, frameCount, outputPrefix)Execute internal.
| Parameter | Type | Default | Description |
|---|---|---|---|
baseDirectory | dynamic | — | Root directory containing the Quake installation. |
gameDirectory | dynamic | — | Selected Quake game-data directory. |
mapName | dynamic | — | Name of the map to load or inspect. |
frameCount | dynamic | — | Number of entries or units to process. |
outputPrefix | dynamic | — | The output prefix input consumed by `runInternal`. |
function safeText(value)Return a validated safe text value.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | dynamic | — | Value consumed by `safeText`. |
function serverEdictsHash(session)Implements the `serverEdictsHash` operation for `miniquake.compat_trace` (server edicts hash).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `serverEdictsHash`. |
function snapshotClientJson(session)Implements the `snapshotClientJson` operation for `miniquake.compat_trace` (snapshot client json).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `snapshotClientJson`. |
function snapshotDigestsJson(session)Implements the `snapshotDigestsJson` operation for `miniquake.compat_trace` (snapshot digests json).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `snapshotDigestsJson`. |
function snapshotHostJson(session)Implements the `snapshotHostJson` operation for `miniquake.compat_trace` (snapshot host json).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `snapshotHostJson`. |
function snapshotJson(session, frameIndex, phase, errorText)Implements the `snapshotJson` operation for `miniquake.compat_trace` (snapshot json).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `snapshotJson`. |
frameIndex | dynamic | — | Zero-based index of the requested entry. |
phase | dynamic | — | The phase input consumed by `snapshotJson`. |
errorText | dynamic | — | The error text input consumed by `snapshotJson`. |
function snapshotPlayerJson(session)Implements the `snapshotPlayerJson` operation for `miniquake.compat_trace` (snapshot player json).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `snapshotPlayerJson`. |
function snapshotQuakeCJson(session)Implements the `snapshotQuakeCJson` operation for `miniquake.compat_trace` (snapshot quake c json).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `snapshotQuakeCJson`. |
function snapshotServerJson(session)Implements the `snapshotServerJson` operation for `miniquake.compat_trace` (snapshot server json).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `snapshotServerJson`. |
function stagesHash(session)Implements the `stagesHash` operation for `miniquake.compat_trace` (stages hash).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `stagesHash`. |
function summaryJson(ok, requested, written, accepted, rollingHash, tracePath, snapshotPath, contextPath, lastStage, errorText, cleanShutdown, diagnosticWriteError)Implements the `summaryJson` operation for `miniquake.compat_trace` (summary json).
| Parameter | Type | Default | Description |
|---|---|---|---|
ok | dynamic | — | The ok input consumed by `summaryJson`. |
requested | dynamic | — | The requested input consumed by `summaryJson`. |
written | dynamic | — | The written input consumed by `summaryJson`. |
accepted | dynamic | — | The accepted input consumed by `summaryJson`. |
rollingHash | dynamic | — | The rolling hash input consumed by `summaryJson`. |
tracePath | dynamic | — | Filesystem path used by the operation. |
snapshotPath | dynamic | — | Filesystem path used by the operation. |
contextPath | dynamic | — | Filesystem path used by the operation. |
lastStage | dynamic | — | The last stage input consumed by `summaryJson`. |
errorText | dynamic | — | The error text input consumed by `summaryJson`. |
cleanShutdown | dynamic | — | The clean shutdown input consumed by `summaryJson`. |
diagnosticWriteError | dynamic | — | The diagnostic write error input consumed by `summaryJson`. |
const TRACE_SCHEMA = 1Defines the trace schema value used by `miniquake.compat_trace`.
function traceErrorLine(frameIndex, lastStage, message)Trace error line through the collision world.
| Parameter | Type | Default | Description |
|---|---|---|---|
frameIndex | dynamic | — | Zero-based index of the requested entry. |
lastStage | dynamic | — | The last stage input consumed by `traceErrorLine`. |
message | dynamic | — | Diagnostic message that explains a failure or event. |
function traceLine(session, frameIndex, accepted)Implements the `traceLine` operation for `miniquake.compat_trace` (trace line).
| Parameter | Type | Default | Description |
|---|---|---|---|
session | dynamic | — | The session input consumed by `traceLine`. |
frameIndex | dynamic | — | Zero-based index of the requested entry. |
accepted | dynamic | — | The accepted input consumed by `traceLine`. |
function vec3Error(label, value)Implements the `vec3Error` operation for `miniquake.compat_trace` (vec3 error).
| Parameter | Type | Default | Description |
|---|---|---|---|
label | dynamic | — | The label input consumed by `vec3Error`. |
value | dynamic | — | Value consumed by `vec3Error`. |
function vec3Hex(value, label)Implements the `vec3Hex` operation for `miniquake.compat_trace` (vec3 hex).
| Parameter | Type | Default | Description |
|---|---|---|---|
value | dynamic | — | Value consumed by `vec3Hex`. |
label | dynamic | — | The label input consumed by `vec3Hex`. |
function writeFile(path, text)Encode and write file.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | dynamic | — | Filesystem path to process. |
text | dynamic | — | Text to parse or process. |