2026-02-24 22:36:01 -05:00
|
|
|
# Module Dependencies in Luprex
|
|
|
|
|
|
|
|
|
|
Modules are listed in dependency order — each module's dependencies
|
|
|
|
|
all appear earlier in the list. Where a dependency comes only from
|
|
|
|
|
the `.cpp` file (not the `.hpp`), it is marked **(cpp-only)**.
|
|
|
|
|
|
|
|
|
|
- **eng-malloc** — custom deterministic memory allocator
|
|
|
|
|
- **enginewrapper** — pure C interface for driver/driven boundary
|
|
|
|
|
- **spookyv2** — hash function
|
|
|
|
|
- **util** → spookyv2
|
|
|
|
|
- **luastack** → util
|
|
|
|
|
- **luavector** → luastack
|
|
|
|
|
- **traceback** → luastack
|
|
|
|
|
- **debugcollector** → util
|
|
|
|
|
- **streambuffer** → eng-malloc, luastack, util
|
|
|
|
|
- **table** → luastack
|
2026-02-25 02:54:54 -05:00
|
|
|
- **keywords** → luastack, util(cpp-only)
|
|
|
|
|
- **pprint** → luastack, table(cpp-only), util(cpp-only)
|
2026-02-24 22:36:01 -05:00
|
|
|
- **json** → luastack, util
|
2026-02-25 02:54:54 -05:00
|
|
|
- **invocation** → enginewrapper, streambuffer
|
|
|
|
|
- **drivenengine** → enginewrapper, invocation, streambuffer, util, animqueue(cpp-only)
|
2026-02-24 22:36:01 -05:00
|
|
|
- **luasnap** → luastack, streambuffer
|
|
|
|
|
- **serializelua** → luastack, streambuffer
|
|
|
|
|
- **sched** → luastack, streambuffer
|
|
|
|
|
- **idalloc** → debugcollector, luastack, streambuffer
|
|
|
|
|
- **animqueue** → debugcollector, luastack, streambuffer, util
|
|
|
|
|
- **printbuffer** → debugcollector, invocation, streambuffer, util
|
2026-02-25 02:54:54 -05:00
|
|
|
- **source** → debugcollector, luastack, streambuffer, util, luasnap(cpp-only), table(cpp-only), traceback(cpp-only)
|
|
|
|
|
- **planemap** → luastack, util
|
|
|
|
|
- **http** → drivenengine, keywords, luastack, streambuffer, json(cpp-only), util(cpp-only)
|
|
|
|
|
- **world** → animqueue, debugcollector, http, idalloc, invocation, luasnap, luastack, planemap, printbuffer, pprint(cpp-only), sched, serializelua(cpp-only), source, streambuffer, table(cpp-only), traceback(cpp-only)
|
2026-02-24 22:36:01 -05:00
|
|
|
- **lpxclient** → drivenengine, invocation, printbuffer, util, world
|
|
|
|
|
- **lpxserver** → drivenengine, luastack, printbuffer, util, world
|
2026-02-25 02:54:54 -05:00
|
|
|
- **unit-testing** → drivenengine(cpp-only), streambuffer(cpp-only), traceback(cpp-only), world(cpp-only)
|
2026-02-24 22:36:01 -05:00
|
|
|
|
|
|
|
|
## Observations
|
|
|
|
|
|
|
|
|
|
### http depends on drivenengine (header-level)
|
|
|
|
|
|
|
|
|
|
`http.hpp` includes `drivenengine.hpp` because it uses
|
|
|
|
|
`SharedChannel` (defined in drivenengine). Meanwhile, `world`
|
2026-02-25 02:54:54 -05:00
|
|
|
depends on both `http` and `drivenengine`, but `drivenengine` no
|
|
|
|
|
longer depends on `world` (that circular dependency was broken).
|
|
|
|
|
The remaining concern is that `SharedChannel` is an I/O concept
|
|
|
|
|
from the driver boundary. Moving `SharedChannel` and `Channel`
|
|
|
|
|
into a smaller, lower-level header (perhaps `enginewrapper.hpp`
|
|
|
|
|
or a new `channel.hpp`) would let `http` drop its dependency on
|
|
|
|
|
`drivenengine` entirely.
|
|
|
|
|
|
|
|
|
|
### world is a mega-consumer
|
2026-02-24 22:36:01 -05:00
|
|
|
|
|
|
|
|
`world` depends on nearly every other module. This is expected for
|
|
|
|
|
the central game-state container, but it does make `world` hard to
|
|
|
|
|
test in isolation. The `world-*.cpp` split into multiple files
|
|
|
|
|
helps readability but doesn't reduce coupling.
|