| docs: replace testcases.md with per-group test-groups.md doc/testcases.md duplicated per-case descriptions that guidelines.md:39-50 already designates as belonging in file-level Doxygen comments (which doxygen renders as the per-case catalog). The markdown had drifted in both directions: it listed groups cc_datapath and nc_datapath that were never registered in source, and missed cc_mmap_consistency and nc_mmap_consistency that were. It was also orphaned at the wrong level (doc/ top-level instead of doc/test-writers/) — nothing in the repo referenced it. Replace with doc/test-writers/test-groups.md containing only: - the group-to-directory mapping (verified against actual group_name strings in source) - a 1-2 sentence per-group description, to guide test writers placing new cases Drop the per-case rows; doxygen + the existing @brief annotations cover that catalog. The file-level @brief blocks can be enriched incrementally per guidelines.md where they are currently too thin. Document the principle (per-case catalog from doxygen, per-group in test-groups.md) in the repo skill .agents/skills/obmm-test-writer/ SKILL.md so it loads for test-writer tasks, and add a cross-reference from guidelines.md. | 2 个月前 |
| enhance: make build version explicit Signed-off-by: Yiqun Liu <yiqun.liu.dev@outlook.com> | 5 个月前 |
| ub_sysfs: resolve physical port IDs in load_controller_ports load_controller_ports now owns the full port-storage lifecycle: it queries mami4ubmem_get_enabled_port_mask for the controller's die, scans the UB bus controller sysfs, and converts each scanned entry from its firmware-enabled (sysfs-facing) port ID to its static physical port ID in-place before caching it. This keeps all mask handling inside one function instead of splitting the scan and the relabel across load_controller_info and load_controller_state. load_controller_state queries the UB die version once and resolves the static physical port count from the contract spec via the new ubmem_physical_ports_per_die helper (summing ports_per_decoder[]), passing it into load_controller_ports. The spec is now the source of truth for the physical port count, including boot-time-disabled ports, rather than deriving it from the enabled-port mask. This fixes the conflation bug where a boot-time-disabled physical port caused sysfs to renumber the remaining ports densely from 0, and the cached view silently treated the renumbered (enabled) IDs as physical IDs -- producing wrong decoder/UMMU resolution and wrong port CNAs once any port was disabled. With the in-place conversion, get_ub_controller_port_cna and get_ub_controller_physical_port_count speak physical IDs externally, and resolve_controller_and_validate_port inherits the fix unchanged via the spec-derived count. When the mask query returns EOPNOTSUPP (real libmami4ubmem has not shipped the symbol yet, or MAMI does not support it on this host), the conversion is identity and the cached view is unchanged, preserving the legacy behavior. When the die version or spec is unavailable, the scanned count is used as the degraded physical port count. The bijection formulas are exposed as the static-inline ub_port_id_physical_to_enabled and ub_port_id_enabled_to_physical helpers in ub_sysfs.h. | 2 个月前 |
| doc: document physical vs enabled port-ID model Revise the contract header comment for struct ub_port_id, the test-writer reference doc, and the usage guide's topology section to establish the two-ID model before the sysfs fix lands. Physical port IDs are static, hardware-defined, dense from 0, and include firmware-disabled ports. Enabled port IDs are the dense index over the firmware-enabled subset only, assigned in ascending physical-port order, and used by sysfs directory names and MAMI. The firmware disables ports at boot time (not at runtime), so the enabled set is static after the driver loads. When no ports are disabled the two coincide. Document the mami4ubmem_get_enabled_port_mask bitmask and the bijection formulas, plus the all-ones fallback for unsupported mask queries. State explicitly in usage.md that the link grammar's port value is the static physical port ID, not the firmware-enabled one. | 2 个月前 |
| ub_sysfs: resolve physical port IDs in load_controller_ports load_controller_ports now owns the full port-storage lifecycle: it queries mami4ubmem_get_enabled_port_mask for the controller's die, scans the UB bus controller sysfs, and converts each scanned entry from its firmware-enabled (sysfs-facing) port ID to its static physical port ID in-place before caching it. This keeps all mask handling inside one function instead of splitting the scan and the relabel across load_controller_info and load_controller_state. load_controller_state queries the UB die version once and resolves the static physical port count from the contract spec via the new ubmem_physical_ports_per_die helper (summing ports_per_decoder[]), passing it into load_controller_ports. The spec is now the source of truth for the physical port count, including boot-time-disabled ports, rather than deriving it from the enabled-port mask. This fixes the conflation bug where a boot-time-disabled physical port caused sysfs to renumber the remaining ports densely from 0, and the cached view silently treated the renumbered (enabled) IDs as physical IDs -- producing wrong decoder/UMMU resolution and wrong port CNAs once any port was disabled. With the in-place conversion, get_ub_controller_port_cna and get_ub_controller_physical_port_count speak physical IDs externally, and resolve_controller_and_validate_port inherits the fix unchanged via the spec-derived count. When the mask query returns EOPNOTSUPP (real libmami4ubmem has not shipped the symbol yet, or MAMI does not support it on this host), the conversion is identity and the cached view is unchanged, preserving the legacy behavior. When the die version or spec is unavailable, the scanned count is used as the degraded physical port count. The bijection formulas are exposed as the static-inline ub_port_id_physical_to_enabled and ub_port_id_enabled_to_physical helpers in ub_sysfs.h. | 2 个月前 |
| build: fix path error and tighten agent checks Signed-off-by: Yiqun Liu <yiqun.liu.dev@outlook.com> | 2 个月前 |
| ub_sysfs: resolve physical port IDs in load_controller_ports load_controller_ports now owns the full port-storage lifecycle: it queries mami4ubmem_get_enabled_port_mask for the controller's die, scans the UB bus controller sysfs, and converts each scanned entry from its firmware-enabled (sysfs-facing) port ID to its static physical port ID in-place before caching it. This keeps all mask handling inside one function instead of splitting the scan and the relabel across load_controller_info and load_controller_state. load_controller_state queries the UB die version once and resolves the static physical port count from the contract spec via the new ubmem_physical_ports_per_die helper (summing ports_per_decoder[]), passing it into load_controller_ports. The spec is now the source of truth for the physical port count, including boot-time-disabled ports, rather than deriving it from the enabled-port mask. This fixes the conflation bug where a boot-time-disabled physical port caused sysfs to renumber the remaining ports densely from 0, and the cached view silently treated the renumbered (enabled) IDs as physical IDs -- producing wrong decoder/UMMU resolution and wrong port CNAs once any port was disabled. With the in-place conversion, get_ub_controller_port_cna and get_ub_controller_physical_port_count speak physical IDs externally, and resolve_controller_and_validate_port inherits the fix unchanged via the spec-derived count. When the mask query returns EOPNOTSUPP (real libmami4ubmem has not shipped the symbol yet, or MAMI does not support it on this host), the conversion is identity and the cached view is unchanged, preserving the legacy behavior. When the die version or spec is unavailable, the scanned count is used as the degraded physical port count. The bijection formulas are exposed as the static-inline ub_port_id_physical_to_enabled and ub_port_id_enabled_to_physical helpers in ub_sysfs.h. | 2 个月前 |
| obmm_import_api: skip dies with no active ports in import_pa_validate step1 run_step1 walks every die of every UB-attached package. A die whose firmware-enabled port mask is zero has no usable decoders and tripped the 'failed both cacheable and noncacheable modes' assertion in step1_for_one_decoder. Query mami4ubmem_get_enabled_port_mask per die and continue past dies with an empty mask; treat a query failure as a hard error per ASSERT_ERRNO_MSG. | 2 个月前 |
| tools: add performance result visualizer Signed-off-by: Yiqun Liu <yiqun.liu.dev@outlook.com> | 5 个月前 |
| docs: add shared style guide and clang-format config Signed-off-by: Yiqun Liu <yiqun.liu.dev@outlook.com> | 5 个月前 |
| docs: add shared style guide and clang-format config Signed-off-by: Yiqun Liu <yiqun.liu.dev@outlook.com> | 5 个月前 |
| Centralize copied OBMM shmdev UAPI and fix repo-hygiene issues Move the OBMM_SHM_MEM_*, OBMM_SHM_CACHE_* constants, struct obmm_cmd_update_range, and OBMM_SHMDEV_UPDATE_RANGE ioctl macro out of utils/update_range.h/.c (where they were copied from the kernel UAPI ub/obmm.h) into include/compat/libobmm-compat.h. The compat header now mirrors the full OBMM shmdev UAPI alongside the existing export/import flag constants: in direct-link mode they come from the real ub/obmm.h, in compatibility mode from framework-owned declarations. Behavior is unchanged. Other repository cleanup folded into this commit: - Translate the Chinese spec-quote comments in import_numa_specifier.c to English (English-only source convention). - Remove doc/testcases.md, an unreferenced temporary Chinese commit-backup scratch file. - Add build-dl/ and build-pedantic/ to .gitignore so the alternate build output directories are ignored alongside build/. | 3 个月前 |
| build: fix path error and tighten agent checks Signed-off-by: Yiqun Liu <yiqun.liu.dev@outlook.com> | 2 个月前 |
| build: split utils into libobmm_utils, narrow framework lib to runtime Split the grab-bag libobmm_test.a into two libraries with distinct audiences: libobmm_test.a (obmm_test) = framework runtime: the distributed- test plumbing (comm, config, log, registry, proc/actor context, ub_topology, fatal_cleanup, test_registry) + the optional-runtime loaders (runtime_loader, libobmm_module, mami4ubmem_module) libobmm_utils.a (obmm_utils) = all src/utils/*.c (data, datapath, numa_setup, parse, param_fmt, obmm_dev, os_info, ub_*, ubmem_vendor, export, import, sync, update_range, proc_maps) Before this, libobmm_test.a bundled framework runtime, test-writer utils, and loaders together, even though the framework core uses zero utils (grep: no src/framework/*.c or include/framework/*.h includes a utils header) and the audience split documented in AGENTS.md / doc/test-writers/api.md is framework-maintainer vs test-writer. The utils are framework-USERS (they call LOG_ERROR/ASSERT_MSG from log.c/fatal_cleanup.c), not framework-internals, so bundling them inside the framework lib was a category error. The dead target_include_directories(obmm_test PRIVATE ${CMAKE_SOURCE_DIR}/src/utils) -- legacy from when framework core supposedly consumed utils internals -- is removed; no framework source used it. Dependency direction is one-way: obmm_utils PUBLIC-links obmm_test (LOG/ASSERT + numa/dl/ubmem_contract inherit transitively); obmm_test does not depend on obmm_utils. Loaders stay in obmm_test because the loader API (obmm_test_init_optional_runtimes) is called only by the conductor (src/conductor/main.c:131); the orchestrator and test binaries never reference it and static linking drops the unreferenced loader objects from them. Wire obmm_utils into the conductor and orchestrator link lines after the --whole-archive test-objects block and before obmm_test, so the test objects' utils references resolve against obmm_utils and obmm_utils's framework references resolve against obmm_test. Apply obmm_apply_warnings(obmm_utils) in the top CMakeLists so the utils keep the project warning set they previously got via obmm_test. Use file(GLOB) for the utils source list (matches tests/CMakeLists.txt) so new utils sources are picked up without a CMake edit. No source files move and no behavior changes; this is build wiring only. Verified: libobmm_test.a no longer contains fill_data/check_data/ permute_memory_blocks (moved to libobmm_utils.a) but still contains obmm_test_init_optional_runtimes + obmm_test_run_fatal_cleanup; clean build with the project warning set; local_smoke 8/8. | 2 个月前 |
| initial commit Signed-off-by: Yiqun Liu <yiqun.liu.dev@outlook.com> | 5 个月前 |
| doc: document the libobmm_utils / libobmm_test split Update the user- and maintainer-facing docs to reflect the two-library split introduced by the prior build commits: README.md "What It Provides": list libobmm_utils.a alongside libobmm_test.a, describing each lib's scope (framework runtime + optional-runtime loaders vs reusable test-writer utility helpers) and noting that test cases pull libobmm_utils.a transitively via obmm_test_cases. doc/test-writers/usage.md build-output inventory: list libobmm_utils.a under the produced artifacts with the same scope note, so test writers know they do not normally link it directly. doc/framework-maintainers/design/framework.md "Build System Design": - Library Types: add a STATIC Library (obmm_utils) entry mirroring the obmm_test entry, describing its source set (src/utils/*.c via file(GLOB)), one-way dep on obmm_test for LOG/ASSERT, and audience (test-writer utility helpers under include/utils/). - Linking Strategy diagrams: show obmm_utils in both the conductor and orchestrator link stacks, ordered after the test objects (which reference utils) and before obmm_test (which utils reference); note that the orchestrator does not call the loader API and static linking drops the unreferenced loader objects from it. - Platform-Specific Linking cmake snippets: insert obmm_utils before obmm_test in the Linux and macOS examples and explain the ordering rationale (utils reference the framework runtime; the reverse order would leave utils symbols unresolved under static linking). doc/framework-maintainers/design/vendor_extension.md "Dispatch Infrastructure": re-attribute the vendor dispatch core (ubmem_vendor.c / dummy_ops / ub_die_vendor_init / the registry) to libobmm_utils.a (where src/utils/*.c now compiles after the split), not "the framework core" / libobmm_test.a. Restate the standalone-link invariant in terms of obmm_utils (it links standalone with no vendor-archive dep) and the one-way dep direction as vendor -> obmm_utils -> obmm_test, never reverse. The invariant itself is unchanged; only the library attribution was stale. No source or build changes; docs only. | 2 个月前 |