Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Appendix — Recovered Source-File Path Glossary

Every path, address, and binary on this page applies to neuronx_cc 2.24.5133.0+58f8de22 (cp310 wheel; the IDA string dumps backing this page are the cp310 set, so the build root is uniformly …KaenaCompilerNativeBuild-310/…/src-3.10.16/…). cp311/cp312 carry byte-near-identical twins that renumber addresses and substitute the -311/-312 build root. Other versions will differ.

Abstract

The shipped neuronx-cc binaries were compiled with assert(...) left in. Each surviving assert expansion plants its __FILE__ argument — the compiler's own source-file path — as an interned string in .rodata, frequently followed by a :lineno suffix from the __LINE__ macro. This appendix is the glossary of those recovered path strings: it takes every neuronxcc-internal source-file literal found in the binaries' string tables and maps it to the subsystem it implements and the wiki page that documents that subsystem.

These strings are direct binary evidence of internal structure. A path like walrus/coloring_allocator/src/sb_allocator/sb_spill.cpp is not a guess about how the allocator is organized — it is the literal byte sequence the compiler emits when an assertion in its spill code fires, recovered from the .rodata of libwalrus.so. The path is the module boundary, the directory is the subsystem decomposition, and the :lineno suffix pins the assertion to a line. Where a normative page says "the SBUF allocator's spill phase", this appendix shows the file that phase lives in. The provenance model behind treating these as ground truth — and the firewall that keeps this wiki derived solely from binary analysis — is §0.3 Methodology.

The glossary is curated by relevance, not exhaustive. The cp310 dumps carry 309 distinct neuronxcc-internal source paths (plus thousands of vendored external/com_google_absl/…, protobuf, re2, onednn paths that are not neuronx-cc source and are excluded here). This page reproduces the compiler-source paths a reader will actually want to resolve — the IR core, the backend passes, the allocators, the codegen, the simulator, the dtype support, the generators — grouped by the subsystem prefix that is the path's own first directory. §1 explains how the strings are planted and how to re-extract them; §2§9 are the per-subsystem tables; §10 re-confirms five literals byte-for-byte against the cited binary's _strings.json.

Targetneuronx_cc 2.24.5133.0+58f8de22 (cp310 wheel)
Evidence formassert(...) __FILE__/__LINE__ literals + embedded path strings in .rodata
Source artifactper-binary …_strings.json (IDA string dumps); each entry tagged "category": "path"
Build root (cp310)/opt/workspace/KaenaCompilerNativeBuild-310/build/private/src-3.10.16/neuronxcc/
Distinct neuronxcc paths309 (after excluding vendored external/… third-party trees)
C++ (.cpp/.cc/.h/.hpp)307 distinct
Python-origin (.py/.pyx)instabrew/brewer.py + EmbeddedWalrusDriver.pyx + ErrorMessages.pyx
Binaries carrying neuronxcc pathslibwalrus.so, libBIR.so, libBIRSimulator.so, krtlib, the per-pass *_with_loop/full_unroll/… split ELFs, libbuiltincustomop_cpu0..7

NOTE — every path quoted below is reproduced verbatim from a binary string table, stripped only of the constant build-root prefix and any :lineno suffix for readability. The full literal (with prefix and line) is what appears in the binary; §10 shows three of them in full. These are the compiler's own embedded paths — they are not sourced from any external, leaked, or reconstructed source tree, and nothing on this page describes source the project did not ship in the binary.


1. How the paths got into the binary

A path string reaches .rodata through one of three mechanisms, all of them ordinary C/C++ build artifacts that a stripped binary still carries:

(1) assert(cond)  →  __assert_fail("cond", __FILE__, __LINE__, __func__)
        the libc assert macro interns __FILE__ as a string operand of the
        __assert_fail call. Surviving asserts ⇒ the full source path is in .rodata,
        usually as "<path>" and a separate ":<lineno>" or "<path>:<lineno>".

(2) custom check/throw macros  →  log("<file>:<line> <expr>")
        e.g. libbuiltincustomop's sort_and_merge.cpp asserts surface as ONE string
        "sort_and_merge.cpp:122 right_data_buffer != nullptr && ..." — file, line,
        and the failed predicate concatenated (category "generic", not "path").

(3) generator provenance banners  →  literal "Generated by brewer from … brewer.py …"
        the instabrew generator stamps each emitted *OpGen module with a banner
        naming its own generator source — brewer.py — and the .pyx it came from.

The IDA string-dump pipeline classifies each literal; neuronxcc source paths land in "category": "path" (mechanisms 1 and 3 with a full build-root prefix) or "category": "generic" (mechanism 2, the concatenated file:line predicate form). Both are recovered by the same sweep.

Re-extracting the glossary

  # all neuronxcc-internal source paths, any binary, strip build-root + :lineno
  for f in ida/*/*_strings.json; do
    jq -r '.[].value | select(test("src-3\\.10\\.16/neuronxcc/")) |
           select(test("\\.(cpp|cc|hpp|h|py|pyx)"))' "$f"
  done | sed 's#.*/neuronxcc/##; s/:[0-9].*$//' | sort -u
  #   => 309 distinct paths (the rows below)
  # the build root is uniform across the cp310 dumps:
  #   /opt/workspace/KaenaCompilerNativeBuild-310/build/private/src-3.10.16/neuronxcc/

GOTCHA — the dumps also carry thousands of external/com_google_absl/…, external/com_google_protobuf/…, external/com_googlesource_code_re2/…, and external/onednn/… paths. Those are statically-linked third-party sources (Abseil, protobuf, RE2, oneDNN), not neuronx-cc code, and are excluded from every table here. The discriminator is the …/src-3.10.16/neuronxcc/ prefix versus …/external/. Only the neuronxcc/ subtree is the compiler's own source.


2. The six anchor paths

These six are the brief's worked examples and the highest-value entries — each names a distinct subsystem and resolves to a documented page. All are reproduced verbatim from the cited binary's _strings.json (category: path, except the custom-op asserts which are generic).

Recovered path (under neuronxcc/)BinaryLangSubsystemWiki page
walrus/neff_packager/src/neff_packager.cpplibwalrus.so @ 0x1d729d8C++NEFF container assembly (the final-stage packager)NEFF Container
walrus/walrus_loop_flow/loop_optimization/src/loop_profitable_fusion.cpplibwalrus.so @ 0x1ce7238; loop_optimization split ELF @ 0x5c4d60C++Loop-flow fusion profitability heuristicLICM & Fusion
instabrew/brewer.pylibBIR.so @ 0x7208d0; libwalrus.so @ 0x1d31d50; libBIRSimulator.so @ 0x5b3838PyThe *OpGen instruction-encoder generatorbrewer.py Generator
walrus/perf_sim/src/perf_sim.cpplibwalrus.so @ 0x1d83328C++Cost-model / performance simulatorperf_sim Wiring · perfsim Cost Model
support/dtype_impl/float_converter.cpplibBIR.so @ 0x761908; libBIRSimulator.so @ 0x5cae80; krtlib @ 0x6d228C++dtype / float-format conversion supportDtype Catalog · Cast to New Dtype
sort_and_merge.cpp (bare; file:line predicate)libbuiltincustomop_cpu0..7 @ 0x8407d2c0+C++CPU custom-op: bitonic sort/merge top-kBitonic Sort/TopK · CustomOp CPU ABI

NOTE — float_converter.cpp and brewer.py appear in three binaries each. That is expected and itself evidentiary: bir/pelican/dtype support is shared code statically pulled into libBIR, libBIRSimulator, and krtlib (see Symbol & Offset Index §0.1). The same __FILE__ literal in multiple binaries confirms the same translation unit was linked into each. loop_profitable_fusion.cpp appears both in libwalrus.so and as its own standalone loop_optimization pass-driver ELF — the pass ships both ways.

QUIRK — sort_and_merge.cpp is the only anchor with no build-root prefix: the custom-op .so files use a bespoke check macro (mechanism 2) that interns just the basename plus the line and the failed predicate, e.g. sort_and_merge.cpp:618 right_start < dim2. The eight libbuiltincustomop_cpu0..7 copies are byte-identical bodies relocated per-core (0x8407…/0x8427…/…), so the same 17 assert strings recur eight times.


3. walrus/ir/ — the BIR IR core (libwalrus.so)

The walrus/ir/ subtree is the BIR in-memory IR: instruction/block/function objects, access patterns, the affine machinery, and the embedded simulator. These are the densest assert sites; the table is grouped by leaf, representative not exhaustive.

Recovered pathLangWhat it implementsWiki page
walrus/ir/lib/IR/Instruction.cpp · .../InstBuilder.cpp · .../InstructionInfo.cppC++Instruction object, builder, per-op infoInstruction Base
walrus/ir/lib/IR/BasicBlock.cpp · .../Function.cpp · .../Module.cppC++Block / function / module containersInstruction Base
walrus/ir/lib/IR/AccessPattern.cpp · .../PhysicalAccessPattern.cpp · .../SymbolicAccessPattern.cpp · .../RegisterAccessPattern.cppC++The access-pattern familyCodegen AccessPattern
walrus/ir/lib/IR/QuasiAffineExpr.cpp · .../AffinePredicate.cpp · .../IntegerSetAnalysis.cppC++Affine / quasi-affine index algebraAffine Expr Algebra
walrus/ir/lib/IR/MemoryLocation.cpp · .../MemoryLocationSet.cppC++Memory-location modelMemory Locations
walrus/ir/lib/IR/Dtype.cpp · walrus/ir/include/bir/IR/Dtype.hC++BIR dtype enum / tablesDtype Tables
walrus/ir/lib/Simulator/kernel_sim.cpp · .../mat_mult.cpp · .../inst_visitor.cpp · .../logical_neuron_core.cppC++Functional simulator coreSim Core Arithmetic · Sim Dispatch/State
walrus/ir/lib/Simulator/Memory.cpp · .../SyncState.cpp · .../RegState.cpp · .../Engine.cppC++Sim memory / sync / register / engine stateSim Control/Sync
walrus/ir/lib/BarrierCheck/MissingBarrierChecker.cpp · .../BarrierRanger.cpp · .../InstGraph.cppC++Missing-barrier static checkerBarrier Check
walrus/ir/lib/Racecheck/Graph.cppC++Race-condition checker graphRacecheck
walrus/ir/lib/StaticProfiler/StaticProfiler.cppC++Static per-instruction profilerperfsim Cost Model
walrus/ir/lib/Adapters/Json.cpp · walrus/ir/include/bir/ParserDumper/Dumper.hC++BIR↔JSON round-tripJSON Writer · JSON Loader
walrus/ir/lib/Arch/Architectures.cpp · .../EngineInfo.cppC++Per-arch / per-engine descriptorsArch Object Model

4. walrus/coloring_allocator/ — the register/SBUF/PSUM/DRAM allocator (libwalrus.so)

The allocator is a graph-coloring core specialized per memory space; the path tree is the per-space decomposition (each space gets a build/select/spill/simplify/live_range quintet). The *_with_loop variants live in their own coloring_allocator_with_loop ELF.

Recovered path (leaf)SpacePhaseWiki page
coloring_allocator/src/coloring_allocator.cpp(driver)top-level allocator driverAllocator Drivers
coloring_allocator/src/reg_allocator/{reg_build,reg_select,reg_spill,reg_simplify,reg_live_range}.cppregisterbuild / select / spill / simplify / live-rangeAllocator Drivers
coloring_allocator/src/sb_allocator/{sb_build,sb_select,sb_spill,sb_simplify,sb_loads,sb_partners}.cppSBUFthe SBUF quintet + load/partner helpersAllocator Drivers
coloring_allocator/src/psum_allocator/{psum_allocator,psum_select,psum_spill,psum_renumber,psum_costs}.cppPSUMPSUM allocation + cost modelPSUM Allocator
coloring_allocator/src/dram_allocator/{dram_build,dram_select,dram_simplify}.cppDRAM/HBMDRAM coloringDRAM Allocator
coloring_allocator/src/{interval_tree,linearize,linearized_function_allocator}.cpp(shared)interval tree + linearizationAllocator Drivers
walrus_loop_flow/coloring_allocator_with_loop/src/*_with_loop.cpp (16 leaves)allloop-aware allocator variantLoopopt Transforms
linear_scan_allocator/src/{linear_scan_allocator,best_fit_memory_manager}.cpp(alt)linear-scan alternative allocatorAlt Allocators / DMA-Opt

5. walrus/ backend passes (libwalrus.so + per-pass split ELFs)

Each pass directory is a walrus/<pass>/src/<pass>.cpp. The pass-name is the pass purpose; the registry that drives them is walrus/registration/src/backend_pass_manager.cpp. Representative high-traffic passes:

Recovered path (leaf)Pass familyWiki page
registration/src/backend_pass_manager.cpp · registration/src/walrus_pass.cpppass-manager registryThe Pass Catalog
driver/src/walrus_driver.cpp · pass/include/walrus/modular_flow.hbackend driver / flowCodegen Driver
dep_based_optims/{pre_sched,inst_sch,post_sched_pass,time_aware_sched,lnc_aware_sched,shift_left_scheduler}.cppschedulingPost-Sched Schedulers · Reorder / Non-SSA / Pre-Sched
walrus_loop_flow/full_unroll/src/{full_unroll,heuristic_unroll,flatten}.cpploop unrollLoopopt Transforms
walrus_loop_flow/loop_optimization/src/{loop_optimization,loop_profitable_fusion,loop_opt_doctor}.cpploop fusionLICM & Fusion
lower_dma/src/lower_dma.cpp · dma_optimization/src/dma_optimization.cpp · coalesce_dma_blocks/src/coalesce_dma_blocks.cpp · dynamic_dma/src/dynamic_dma.cppDMA lowering / optAlt Allocators / DMA-Opt
lower_{ac,act,ap,branch,control,sync,dve,dynamic_dma,local_collectives,generic_indirect}/src/*.cppop loweringCodegen Driver
value_numbering/src/gvn.cpp · mem2reg/src/mem2reg.cpp · constant_propagate/src/constant_propagate.cpp · early_peephole_opts/src/early_peephole_opts.cppscalar optThe Pass Catalog
lnc_splitter/src/lnc_splitter.cpp · vn_splitter/src/vn_splitting.cpp · bir_splitter/src/bir_splitter.cppcore/VN splittingLNC Splitter · VN Splitter / Shrink
bir_linker/src/{bir_linker,post_link_report}.cpp · vnc_link/src/vnc_link.cpplinkingBIR Linker · VNC Cross-Core Link
partitioner/src/{dag_part,bir_xform,layers}.cpppartitionerSPMD Partitioner Driver
lnc_verifier/src/lnc_verifier.cpp · verifier/src/inst_visitor.cpp · verify_bir_serdes/src/verify_bir_serdes.cppverificationBIR Verifier Per-Op
neff_packager/src/{neff_packager,neff_file_writer}.cppNEFF assemblyNEFF Container · NEFF Header/BOM Writer
dma_metrics/src/dma_metrics.cpp · report_stats/src/report_stats.cppprofiling/statsDMA-Metrics Profiler
inline_bir_kernel/src/kernels_impl/{attn_fwd,attn_bwd,flash_attn_fwd,mlp,qkv,rmsnorm_quant,router_topk,…}.cppinlined fused kernelsTritium Fusion
translate_nki_ast_to_bir/src/{translate_nki_ast_to_bir,klir_to_bir_codegen}.cppNKI-AST → BIRKLIR→BIR Codegen Dispatch

6. walrus/codegen/ — the descriptor / core-generation codegen (libwalrus.so)

Recovered path (leaf)What it implementsWiki page
codegen/src/codegen.cpp · codegen/src/generator.cpp · codegen/include/codegen/generator.hcodegen entry / generatorCodegen Driver
codegen/src/{CoreV2GenImpl,CoreV3GenImpl,CoreV4GenImpl}.cpp (+ .h)per-core-generation descriptor emitCodegen Driver · Codename Taxonomy
codegen/src/descgen.cpp · codegen/src/descgen_helper.cppDMA descriptor generationCodegen Data-Movement
codegen/src/assign_var_id.cppvariable-ID assignmentCodegen Helpers / Kernel Provision
codegen/src/debug_info_writer.cppdebug-info producerSymbol & Offset Index

NOTE — the CoreV2/V3/V4GenImpl triple is the binary's own evidence for the three live core generations. The hwm/ hardware-model files in §8 (cayman_bir.cpp, sunda_bir.cpp, core_v4_bir.cpp) are the matching per-codename device models. Cross-check against Codename Taxonomy and Vestigial Generations.


7. pelican/ — the affine-index / expression IR (libBIR.so)

pelican is the affine-expression / value IR underneath BIR (owned by libBIR.so, §0.1). Its include/pelican/IR/*.h and lib/IR/*.cpp literals appear in libBIR.so's string table.

Recovered pathWhat it implementsWiki page
pelican/lib/IR/{AffineExpr,AffineIdx,AffineIndices,QuasiAffExprs,AffinePredicate}.cppaffine index algebraAffine Expr Algebra · Pelican Index Runtime
pelican/lib/IR/{Expr,Value,Stmt,Instruction}.cppexpression / value / statement corePelican Expr Core
pelican/lib/IR/PelicanContext.cpp · pelican/lib/IR/Access.cppcontext + accessPelican Hierarchy
pelican/lib/Analyses/MemDepGraph.cppmemory-dependence graphISL Schedule-Tree Legality
pelican/include/pelican/IR/{AffineExpr,AffineIndices,CompareExpr,Value}.h · pelican/include/pelican/Support/DType.hpublic headersPelican Wire · Pelican ModuleExpr
pelican/python/{PyAccess,PyValue}.cpp · pelican/python/{PyBlock,PyPelican}.hPython bindingsPelican Hierarchy

8. hwm/, support/ — per-hardware models and shared cores

Recovered pathBinaryWhat it implementsWiki page
hwm/cayman_bir.cpp · hwm/sunda_bir.cpp · hwm/core_v4_bir.cpplibwalrus.soper-codename hardware/device modelsCodename Taxonomy · Hardware Constant Matrix
hwm/ctm.cpplibwalrus.sohardware constant/timing modelHardware Constant Matrix
support/dtype_impl/float_converter.cpplibBIR.so, libBIRSimulator.so, krtlibfloat-format conversion (shared)Dtype Catalog · Cast to New Dtype
metric_bindings/python/pymetrics.cpplibwalrus.soPython metric bindingsDMA-Metrics Profiler

9. Cython-origin .pyx and .py paths

The neuronxcc-internal Python-origin paths are few — most of the frontend is interpreted .py not compiled, so only the Cython-compiled modules plant their .pyx/.py source into a binary. The *OpGen.cpython-310-…so encoder modules are themselves brewer-generated C from those .pyx; each carries a provenance banner naming brewer.py.

Recovered pathBinaryFormWhat it isWiki page
instabrew/brewer.pylibBIR.so, libwalrus.so, libBIRSimulator.so.py (full path)the instruction-encoder generatorbrewer.py Generator
(banner) Generated by brewer from the definition in neuronxcc/instabrew/brewer.py at line 3384~110 *OpGen.cpython-310-…sobanner literalper-*OpGen provenance stampbrewer.py Generator
driver/jobs/support/EmbeddedWalrusDriver.pyxEmbeddedWalrusDriver.cpython-310-…so.pyxthe embedded walrus driver shimTwo-Parser Architecture
ErrorMessages.pyx (bare)ErrorMessages.cpython-310-…so.pyxthe diagnostics dict moduleError-Message Catalog

NOTE — the *OpGen module names in the dump (MatMulOpGen, TensorScalarPtrOpGen.cpytho_…, TiledSoftmaxOpGen.cpyth_…, …) are module/symbol names, not source paths — they are the outputs brewer emitted, each tagged with the brewer.py:3384 banner. The single source-of-truth .py path is instabrew/brewer.py; the :3384 is the emit-site line inside brewer's template engine. This is the binary's own confirmation of the *OpGen-from-brewer contract documented in §7.10.


10. Adversarial verification — five paths re-confirmed

Five literals were re-extracted directly from the cited binary's _strings.json to confirm the byte-exact string is present (not paraphrased). Command form:

jq -r '.[] | select(.value|test("<path>")) | "\(.addr)\t\(.category)\t\(.value)"' \
  ida/<binary>__…_strings.json
#Path (claimed)BinaryRe-confirmed literal & addrStatus
1neff_packager.cpplibwalrus.so…/src-3.10.16/neuronxcc/walrus/neff_packager/src/neff_packager.cpp @ 0x1d729d8, category:path, 4 xrefs (plus :49,:73,:110,:113,:239,:490,:1061 line variants)CONFIRMED
2loop_profitable_fusion.cpplibwalrus.so + loop_optimization ELF…/walrus/walrus_loop_flow/loop_optimization/src/loop_profitable_fusion.cpp @ 0x1ce7238 (libwalrus) and @ 0x5c4d60 (loop_optimization)CONFIRMED (both binaries)
3perf_sim.cpplibwalrus.so…/walrus/perf_sim/src/perf_sim.cpp @ 0x1d83328, category:path (+ :96,:108,:121,:242,:249,:488,:506,:654,:758,:760,:816 line variants)CONFIRMED
4float_converter.cpplibBIR.so · libBIRSimulator.so · krtlib…/support/dtype_impl/float_converter.cpp @ 0x761908 (libBIR), 0x5cae80 (libBIRSimulator), 0x6d228 (krtlib) — same TU in three binariesCONFIRMED (3 binaries)
5sort_and_merge.cpplibbuiltincustomop_cpu0sort_and_merge.cpp:618 right_start < dim2 @ 0x8407d633, category:generic (basename-only file:line predicate form; 17 asserts, replicated cpu0..7)CONFIRMED

NOTE — the category field is itself a provenance signal: neff_packager/perf_sim/float_converter/loop_profitable_fusion all carry "category": "path" (full build-root __FILE__ literals), while sort_and_merge's carry "category": "generic" (the concatenated file:line predicate custom-check form). Both are binary-resident; neither is reconstructed. brewer.py's three hits also carry "category": "path".


Cross-References