from __future__ import annotations

import gc
import inspect
import os
import time
from pathlib import Path
from typing import List

import dill as pickle
import pytest
from inference.core.workflows.core_steps.trackers._base import \
    tracker_describe_outputs
from inference.core.workflows.core_steps.trackers.bytetrack.v1 import \
    ByteTrackManifest
from inference.core.workflows.execution_engine.entities.base import \
    OutputDefinition
from inference.core.workflows.execution_engine.entities.types import \
    OBJECT_DETECTION_PREDICTION_KIND


def codeflash_wrap(codeflash_wrapped, codeflash_test_module_name, codeflash_test_class_name, codeflash_test_name, codeflash_function_name, codeflash_line_id, codeflash_loop_index, *args, **kwargs):
    test_id = f'{codeflash_test_module_name}:{codeflash_test_class_name}:{codeflash_test_name}:{codeflash_line_id}:{codeflash_loop_index}'
    if not hasattr(codeflash_wrap, 'index'):
        codeflash_wrap.index = {}
    if test_id in codeflash_wrap.index:
        codeflash_wrap.index[test_id] += 1
    else:
        codeflash_wrap.index[test_id] = 0
    codeflash_test_index = codeflash_wrap.index[test_id]
    invocation_id = f'{codeflash_line_id}_{codeflash_test_index}'
    test_stdout_tag = f"{codeflash_test_module_name}:{(codeflash_test_class_name + '.' if codeflash_test_class_name else '')}{codeflash_test_name}:{codeflash_function_name}:{codeflash_loop_index}:{invocation_id}"
    print(f'!$######{test_stdout_tag}######$!')
    exception = None
    gc.disable()
    try:
        counter = time.perf_counter_ns()
        return_value = codeflash_wrapped(*args, **kwargs)
        codeflash_duration = time.perf_counter_ns() - counter
    except Exception as e:
        codeflash_duration = time.perf_counter_ns() - counter
        exception = e
    gc.enable()
    print(f'!######{test_stdout_tag}######!')
    iteration = os.environ['CODEFLASH_TEST_ITERATION']
    with Path('{codeflash_run_tmp_dir_client_side}', f'test_return_values_{iteration}.bin').open('ab') as f:
        pickled_values = pickle.dumps((args, kwargs, exception)) if exception else pickle.dumps((args, kwargs, return_value))
        _test_name = f"{codeflash_test_module_name}:{(codeflash_test_class_name + '.' if codeflash_test_class_name else '')}{codeflash_test_name}:{codeflash_function_name}:{codeflash_line_id}".encode('ascii')
        f.write(len(_test_name).to_bytes(4, byteorder='big'))
        f.write(_test_name)
        f.write(codeflash_duration.to_bytes(8, byteorder='big'))
        f.write(len(pickled_values).to_bytes(4, byteorder='big'))
        f.write(pickled_values)
        f.write(codeflash_loop_index.to_bytes(8, byteorder='big'))
        f.write(len(invocation_id).to_bytes(4, byteorder='big'))
        f.write(invocation_id.encode('ascii'))
    if exception:
        raise exception
    return return_value

class TestByteTrackManifestDescribeOutputs:
    """Test suite for ByteTrackManifest.describe_outputs() method."""

    def test_describe_outputs_returns_list(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that describe_outputs returns a list.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_returns_list', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_returns_list_of_output_definitions(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that describe_outputs returns a list of OutputDefinition objects.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_returns_list_of_output_definitions', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        for item in result:
            pass

    def test_describe_outputs_is_classmethod(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that describe_outputs can be called on the class without instantiation.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_is_classmethod', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_contains_tracked_detections(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that tracked_detections output is present.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_contains_tracked_detections', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        names = [output.name for output in result]

    def test_describe_outputs_contains_new_instances(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that new_instances output is present.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_contains_new_instances', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        names = [output.name for output in result]

    def test_describe_outputs_contains_already_seen_instances(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that already_seen_instances output is present.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_contains_already_seen_instances', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        names = [output.name for output in result]

    def test_describe_outputs_has_exactly_three_outputs(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that describe_outputs returns exactly 3 outputs.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_has_exactly_three_outputs', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_all_outputs_have_object_detection_kind(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that all outputs have OBJECT_DETECTION_PREDICTION_KIND.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_all_outputs_have_object_detection_kind', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        for output in result:
            pass

    def test_describe_outputs_matches_tracker_describe_outputs(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that ByteTrackManifest.describe_outputs matches tracker_describe_outputs.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_matches_tracker_describe_outputs', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        bytetrack_outputs = codeflash_output
        tracker_outputs = tracker_describe_outputs()
        bytetrack_names = [o.name for o in bytetrack_outputs]
        tracker_names = [o.name for o in tracker_outputs]

    def test_describe_outputs_output_name_is_string(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that all output names are strings.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_output_name_is_string', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        for output in result:
            pass

    def test_describe_outputs_output_kind_is_list(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that all output kinds are lists.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_output_kind_is_list', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        for output in result:
            pass

    def test_describe_outputs_idempotent(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that calling describe_outputs multiple times returns identical results.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_idempotent', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result1 = codeflash_output
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_idempotent', 'describe_outputs', '3', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result2 = codeflash_output
        names1 = [o.name for o in result1]
        names2 = [o.name for o in result2]

    def test_describe_outputs_tracked_detections_first(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that tracked_detections is the first output.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_tracked_detections_first', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_new_instances_second(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that new_instances is the second output.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_new_instances_second', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_already_seen_instances_third(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that already_seen_instances is the third output.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_already_seen_instances_third', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_no_duplicate_names(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that there are no duplicate output names.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_no_duplicate_names', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        names = [o.name for o in result]

    def test_describe_outputs_kind_contains_exactly_one_element(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that each output kind list contains exactly one element.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_kind_contains_exactly_one_element', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        for output in result:
            pass

    def test_describe_outputs_kind_is_object_detection_prediction_kind(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that each output kind is specifically OBJECT_DETECTION_PREDICTION_KIND.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_kind_is_object_detection_prediction_kind', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        for output in result:
            pass

    def test_describe_outputs_callable_from_class(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that describe_outputs is callable directly from class.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_callable_from_class', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_returns_mutable_list(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that the returned list is a new list (not shared state).'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_returns_mutable_list', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result1 = codeflash_output
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_returns_mutable_list', 'describe_outputs', '3', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result2 = codeflash_output

    def test_describe_outputs_with_different_call_patterns(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test describe_outputs with different calling patterns.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_with_different_call_patterns', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result_class = codeflash_output
        instance = ByteTrackManifest(type='roboflow_core/trackers_bytetrack@v1', name='test_tracker', image='test_image', detections='test_detections')
        _call__bound__arguments = inspect.signature(instance.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(instance.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_with_different_call_patterns', 'describe_outputs', '4', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result_instance = codeflash_output
        class_names = [o.name for o in result_class]
        instance_names = [o.name for o in result_instance]

    def test_describe_outputs_consistent_across_many_calls(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that describe_outputs is consistent across 1000 calls.'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_consistent_across_many_calls', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        first_result = codeflash_output
        first_names = [o.name for o in first_result]
        for _ in range(1000):
            _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
            _call__bound__arguments.apply_defaults()
            codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_consistent_across_many_calls', 'describe_outputs', '4_0', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
            codeflash_output = codeflash_return_value
            result = codeflash_output
            current_names = [o.name for o in result]
            for i, output in enumerate(result):
                pass

    def test_describe_outputs_performance_acceptable(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that describe_outputs completes quickly even with many calls.'
        import time
        start_time = time.time()
        for _ in range(1000):
            _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
            _call__bound__arguments.apply_defaults()
            codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_performance_acceptable', 'describe_outputs', '3_0', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        elapsed_time = time.time() - start_time

    def test_describe_outputs_all_outputs_serializable(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that all output definitions are serializable (dict-convertible).'
        _call__bound__arguments = inspect.signature(ByteTrackManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(ByteTrackManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestByteTrackManifestDescribeOutputs', 'test_describe_outputs_all_outputs_serializable', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        for output in result:
            if hasattr(output, 'model_dump'):
                output_dict = output.model_dump()