From 65465054821b8e176b060bcf7d5e2e560b03e663 Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Mon, 13 Oct 2025 15:15:28 +0300 Subject: [PATCH 1/3] Create random quaternion trajectories for external orientations --- ci/create_trajectories.py | 17 +++++++++++++++++ ci/run_scheduled_sanitizer_test.py | 10 +++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/ci/create_trajectories.py b/ci/create_trajectories.py index 6b957df092..51f61cd64d 100644 --- a/ci/create_trajectories.py +++ b/ci/create_trajectories.py @@ -1,4 +1,5 @@ import numpy as np +from scipy.spatial.transform import Rotation FRAMES_PER_SEC = 50 @@ -23,3 +24,19 @@ def constant_trajectory(duration_sec, yaw=0, pitch=0, roll=0): trj[:, 3] = roll return trj + +def random_trajectory_quat(duration_sec): + n_frames = int(FRAMES_PER_SEC * duration_sec) + trj = Rotation.random(n_frames).as_quat() + return trj + + +def constant_trajectory_quat(duration_sec, w=1, x=0, y=0, z=0): + n_frames = int(FRAMES_PER_SEC * duration_sec) + trj = np.empty((n_frames, 4)) + trj[:, 0] = w + trj[:, 1] = x + trj[:, 2] = y + trj[:, 3] = z + return trj + diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index c2d3f30d11..fc6c18ddbe 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -43,7 +43,7 @@ from collect_artifacts import ( find_failed_files_for_sanitizer_test, ) from combine_genpatt_and_jbm_profile import combine_error_profiles -from create_trajectories import random_trajectory +from create_trajectories import random_trajectory, random_trajectory_quat SCRIPT_DIR = pathlib.Path("./scripts").resolve() @@ -156,10 +156,10 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr # create random trajectory files if "BINAURAL" in oc_str: - trajectory_files = [HEAD_TRAJ_FILE, EXOF_TRAJ_FILE] - for tf in trajectory_files: - traj = random_trajectory(int(DURATION)) - np.savetxt(tf, traj, fmt="%.2f", delimiter=",") + traj = random_trajectory(int(DURATION)) + np.savetxt(HEAD_TRAJ_FILE, traj, fmt="%.2f", delimiter=",") + traj_exof = random_trajectory_quat(int(DURATION)) + np.savetxt(EXOF_TRAJ_FILE, traj_exof, fmt="%.2f", delimiter=",") ### always run encoder and decoder with no frameloss cmd_no_fec = [ -- GitLab From 714ca36336956310575766db920eb5cfd69e00ae Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 13 Oct 2025 17:38:37 +0200 Subject: [PATCH 2/3] add reproducibility for random parts of sanitizer tests - seed the numpy rng with CI_JOB_ID - add command line arg for injecting a custom seed --- ci/create_trajectories.py | 6 +-- ci/run_scheduled_sanitizer_test.py | 70 ++++++++++++++++-------------- 2 files changed, 41 insertions(+), 35 deletions(-) diff --git a/ci/create_trajectories.py b/ci/create_trajectories.py index 51f61cd64d..522a26461d 100644 --- a/ci/create_trajectories.py +++ b/ci/create_trajectories.py @@ -3,12 +3,13 @@ from scipy.spatial.transform import Rotation FRAMES_PER_SEC = 50 +MAGIC_VAL_TO_SIGNAL_EULER_ANGLES = -3 def random_trajectory(duration_sec): n_frames = int(FRAMES_PER_SEC * duration_sec) trj = np.random.random((n_frames, 4)) - trj[:, 0] = -3 + trj[:, 0] = MAGIC_VAL_TO_SIGNAL_EULER_ANGLES trj[:, 1] *= 180 trj[:, 2] *= 90 trj[:, 3] *= 180 @@ -18,7 +19,7 @@ def random_trajectory(duration_sec): def constant_trajectory(duration_sec, yaw=0, pitch=0, roll=0): n_frames = int(FRAMES_PER_SEC * duration_sec) trj = np.empty((n_frames, 4)) - trj[:, 0] = -3 + trj[:, 0] = MAGIC_VAL_TO_SIGNAL_EULER_ANGLES trj[:, 1] = yaw trj[:, 2] = pitch trj[:, 3] = roll @@ -39,4 +40,3 @@ def constant_trajectory_quat(duration_sec, w=1, x=0, y=0, z=0): trj[:, 2] = y trj[:, 3] = z return trj - diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index fc6c18ddbe..4995c3b953 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -1,38 +1,39 @@ #!/usr/bin/env python3 """ - (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. +(C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository. All Rights Reserved. + +This software is protected by copyright law and by international treaties. +The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository retain full ownership rights in their respective contributions in +the software. This notice grants no license of any kind, including but not limited to patent +license, nor is any license granted by implication, estoppel or otherwise. + +Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +contributions. + +This software is provided "AS IS", without any express or implied warranties. The software is in the +development stage. It is intended exclusively for experts who have experience with such software and +solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +and fitness for a particular purpose are hereby disclaimed and excluded. + +Any dispute, controversy or claim arising under or in relation to providing this software shall be +submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +the United Nations Convention on Contracts on the International Sales of Goods. """ import argparse import pathlib import subprocess import sys +import os import numpy as np import json @@ -75,12 +76,17 @@ ARGS_FOR_OC = { "BINAURAL_ROOM_REVERB": BINAURAL_OUT_ARGS, } +SEED_FOR_RANDOM = int(os.environ.get("CI_JOB_ID", 0)) + def main(args): in_format = args.in_format out_formats = args.out_formats tests = args.tests run_fec = not args.skip_fec + seed = SEED_FOR_RANDOM if args.inject_seed is None else args.inject_seed + + np.random.seed(seed) assert all([t in SUPPORTED_TESTS for t in tests]) @@ -92,7 +98,6 @@ def main(args): def get_modes(in_format: str) -> list: - in_format_for_script = in_format if in_format in MC_MODES: in_format_for_script = "MC" @@ -134,7 +139,6 @@ def assemble_oc_dict(out_formats: list): def get_md_file_command(in_format: str) -> list: - cmd = list() if "ISM" in in_format: cmd.append("--ism_metadata_files") @@ -145,8 +149,7 @@ def get_md_file_command(in_format: str) -> list: return cmd -def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = True): - +def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool): modes = get_modes(in_format) if len(modes) == 0: return 0 @@ -187,7 +190,7 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr # resue decoder part of StereDmxEVS mode (it is basically a duplicate of "normal" mono run) if in_format == "StereoDmxEVS": panning = np.random.randint(-90, 91) - cmd_no_fec += [f'-D=-non_diegetic_pan {panning}'] + cmd_no_fec += [f"-D=-non_diegetic_pan {panning}"] print( "======== Script command line WITHOUT plc: ========\n{}".format( @@ -277,5 +280,8 @@ if __name__ == "__main__": parser.add_argument("out_formats", type=str, nargs="+") parser.add_argument("--tests", type=str, nargs="+", default=["CLANG1", "CLANG2"]) parser.add_argument("--skip_fec", action="store_true") + parser.add_argument( + "--inject_seed", type=int, help="Value to use for seeding random generators" + ) sys.exit(main(parser.parse_args())) -- GitLab From 67fd3479bda51a01fe6567f1c1ff353cc2a6edcf Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 13 Oct 2025 17:42:38 +0200 Subject: [PATCH 3/3] add explicit default --- ci/run_scheduled_sanitizer_test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index 4995c3b953..071270610f 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -281,7 +281,10 @@ if __name__ == "__main__": parser.add_argument("--tests", type=str, nargs="+", default=["CLANG1", "CLANG2"]) parser.add_argument("--skip_fec", action="store_true") parser.add_argument( - "--inject_seed", type=int, help="Value to use for seeding random generators" + "--inject_seed", + type=int, + default=None, + help="Value to use for seeding random generators", ) sys.exit(main(parser.parse_args())) -- GitLab