# SPDX-License-Identifier: Apache-2.0 """CPU reference of BEVFusion-L (Autoware autoware_bevfusion, lidar-only) -- the ground truth every PCC / output- agreement gate compares against (PLAN.md 0.3 item 1). It runs where ttnn is absent (the research venv) and never imports ttnn. - ``config.py`` the Autoware parameters this port reproduces (the ml_package / remapper / metadata yaml of the weights, ``bevfusion_lidar.param.yaml``, the node's sanitization) and the port's COMPILE constants (256,000 voxels, the sparse level grids, the per-level capacity buckets, top-k 512), each with its source line in autoware_universe @ 9ceaccf026c31ffc5319bc9eeb4bd7bede0af3fd; - ``weights.py`` ``bevfusion_lidar.onnx`` read as data with the vendored ``ttaw.weights.OnnxWeights`` (initializers and constants by consuming node; every wiring assumption asserted from the graph, including the 21 sparse convs' ``GetIndicePairsImplicitGemm`` attributes; all 44 BatchNorms folded in float64 where the TT port folds them); - ``model.py`` fp32 torch rebuild of the deployed graph (gather-form sparse encoder on the host rulebooks, to-dense, SECOND, SECONDFPN, dense head, local max on classes 0-3, ONNX-semantics top-K with optional teacher forcing, query init, decoder, prediction heads, output assembly) with per-module taps (``ttaw.golden.TapRegistry``; names in ``MODULE_TAPS``); - ``ort.py`` ONNX Runtime on the plugin-free dense sub-graph of the shipped ONNX, with optional intermediates (research / tests only: onnxruntime is not in the image; the full graph needs TensorRT plugins); - ``pipeline.py`` the reference end to end: ``host/`` pre-processing -> torch network (or torch sparse + ORT dense) -> ``host/`` post-processing -> ``ttaw.outputs.Detections3D``. Pre- and post-processing are not duplicated here: they live in ``tt_bevfusion.host`` (shared with the device path, so TT and CPU see identical voxel, feature and rulebook tensors) and are tested against the research scripts. The ``to_dict()`` of this reference's output on the shipped sample is stored as ``samples/test_pcd.reference.json``: ``server/smoke_test.py`` compares the served output with it. """