Repository navigation
Conversation
The MIMO transmission modes were removed and TxMode shrank to SINGLE_ANTENNA_PORT0, TRANSMIT_DIVERSITY and the UNKNOWN_TX_MODE sentinel, but the two count constants stayed at 6. LteFeedbackComputationRealistic sizes its per-mode feedback vectors with DL_NUM_TXMODE and stores (TxMode)z for every index, so it wrote 3, 4 and 5 into a TxMode. 3 is not an enumerator, and 4 and 5 are outside the enum's representable range, 0..3 (undefined behaviour; UBSan reports the loads in LteFeedback::setTxMode and LteFeedback::isEmptyFeedback). The AMC also allocated and scanned feedback history buffers for four modes that no longer exist. The constants now take their value from UNKNOWN_TX_MODE, and the loop of the per-remote feedback computation that excluded the removed last mode (MULTI_USER) runs over every mode. The empty feedbacks of the stale modes were never pushed to the AMC, so the fingerprints do not move. tests/unit/TxModeCount.test checks the constants against the enum and that every feedback the realistic computation returns carries a valid TxMode, one entry per mode.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This repository has issues disabled, so the problem description is here.
Problem
TxMode(src/simu5g/common/LteCommonEnum.msg) has two modes and a sentinel since the MIMO removal:but
src/simu5g/common/LteCommon.hstill saysLteFeedbackComputationRealistic::computeFeedbacksizes its per-mode vectors withDL_NUM_TXMODEand stores(TxMode)zfor every index. So it writes 3, 4 and 5 into aTxMode. 3 is not an enumerator. 4 and 5 are outside the representable range of the enum (an enum without a fixed underlying type whose largest enumerator is 2 has the range 0..3), so storing and loading them is undefined behaviour. UBSan reports it on every feedback report:Seen with a
-fsanitize=address,undefineddebug build (Homebrew clang 22.1.8, macOS arm64, OMNeT++ 6.5.0, INET 4.7.0), running a gNB with six NR UEs for 17.5 s. These two are the only sanitizer reports of that run.Besides the undefined behaviour,
LteAmc(lines 289, 980, 989, 1063, 1071) andD2dAmcHelper(70, 140, 271, 336) allocate and scan oneLteSummaryBufferper counted mode, so every UE carries four history buffers for modes that no longer exist.Results do not change today: the feedbacks of the stale modes are empty (
fb.reset()setsstatus_ = EMPTY), andLteMacEnb::macHandleFeedbackPktpushes only non-empty feedbacks to the AMC.Change
LteCommon.h:DL_NUM_TXMODE = UNKNOWN_TX_MODEandUL_NUM_TXMODE = UNKNOWN_TX_MODE, with a comment that the feedback vectors and the AMC histories hold one entry per mode, indexed byTxMode.LteCommonEnum.msg: the note onTxModenow says that the sentinel stays last and the two constants follow it. The old note asked for a manual update of the constants, which is what was missed.LteFeedbackComputationRealistic.cc: the double-vectorcomputeFeedbackloopedz < DL_NUM_TXMODE - 1to skip the removed last mode (MULTI_USER). With the count equal to the number of modes, it loopsz < DL_NUM_TXMODE.tests/unit/TxModeCount.test(new): both constants equalUNKNOWN_TX_MODE, and bothcomputeFeedbackvariants return one entry per mode, each with a validTxMode.Verification
tests/unit/TxModeCount.test: 6 of its 8 checks fail without the change (DL_NUM_TXMODE ... actual=6 expected=2,every stored TxMode is an enumerator, ...). With the change:modelchecks=8 modelfailures=0. The whole unit test set with the change: PASS 36, FAIL 0, ERROR 0, EXPECTEDFAIL 6 (the six expected failures thatdevhas today).tests/fingerprint/fingerprints, release,simulations.csvandsimulations_d2d.csv, 254 rows): the computed fingerprints before and after the change are identical in all 254 rows, and the.UPDATEDfiles are byte-identical. This was run on macOS arm64, where many stored values differ from the Linux CI values anyway (108 failures and 33 errors, the same set in both runs), so CI should confirm on Linux.The commit is on top of
dev(1a3d71b). The macOS measurements above were made ondevplus #1 (the macOS build fix), which this PR does not include.