Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion framework/src/act/act.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from act.coverreport import print_coverage_summary
from act.parse_test_constraints import TestYamlHeaderError, generate_test_dict
from act.parse_udb_config import generate_udb_files, get_config_params, get_implemented_extensions
from act.select_tests import select_tests
from act.select_tests import get_untested_implemented_extensions, select_tests

# CLI interface setup
act_app = typer.Typer(context_settings={"help_option_names": ["-h", "--help"]})
Expand Down Expand Up @@ -100,6 +100,7 @@ def run_act(

config_names: list[str] = []
tasks: list[BuildTask] = []
excluded_extensions = {ext.strip() for ext in exclude.split(",") if ext.strip()}
for config_file in config_files:
# Load configuration
Comment on lines +103 to 105
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excluded_extensions is derived from the CLI --exclude string, which generate_test_dict() applies as a test directory filter (it compares against test_file.parent.name, e.g. Sv). Passing this set into get_untested_implemented_extensions() (which compares against ISA extension tokens like Sv39, Zba, etc.) means excludes like Sv won’t suppress warnings for implemented Sv32/Sv39/..., leading to false-positive warnings. Consider translating excluded directory names into ISA extension names (e.g., treat an excluded prefix like Sv as excluding any implemented extension starting with Sv), or only applying this filter when the excluded value is known to be in the same namespace as implemented_extensions.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like that didn't work.

config = load_config(config_file)
Expand All @@ -115,6 +116,20 @@ def run_act(
selected_tests = select_tests(
full_test_dict, implemented_extensions, config_params, include_priv_tests=config.include_priv_tests
)
if extensions == "all":
untested_extensions = get_untested_implemented_extensions(
selected_tests,
implemented_extensions,
include_priv_tests=config.include_priv_tests,
excluded_extensions=excluded_extensions,
)
if untested_extensions:
print(
f"Warning: {config.name}: no applicable tests selected for implemented extension(s): "
f"{', '.join(untested_extensions)}. Tests may be missing, excluded, or "
"otherwise inapplicable for the current configuration.",
file=sys.stderr,
)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to limit this to just when extensions == "all". If someone limits the list of extensions, we should still warn for extensions that we don't support. Seems like the simplest implementation might be to move this call into select_tests, which is probably a better place for it anyway since this is a warning that comes from the test selection process.

mxlen = config_params["MXLEN"]
if not isinstance(mxlen, int):
raise TypeError(f"MXLEN must be an integer, got {type(mxlen)}: {mxlen!r}")
Comment on lines 103 to 125
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The excluded_extensions filter is derived from the CLI --exclude list, which filters by test directory name (e.g. Sv, ZfaD). In get_untested_implemented_extensions() it’s compared against implemented ISA extension tokens; this works for prefix cases like Sv*, but fails for composite dirs like ZfaD (tests require Zfa/D/F, so excluding ZfaD won’t suppress warnings for Zfa etc.). Either translate excluded test directories into the corresponding REQUIRED_EXTENSIONS tokens (by reading metadata of excluded tests), or only apply this suppression when the excluded value is known to be an ISA extension token.

Copilot uses AI. Check for mistakes.
Expand Down
19 changes: 19 additions & 0 deletions framework/src/act/select_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,22 @@ def select_tests(
if check_test_params(test_params, config_params):
selected_tests[test_name] = test_metadata
return selected_tests


def get_untested_implemented_extensions(
selected_tests: dict[str, TestMetadata],
implemented_extensions: set[str],
*,
include_priv_tests: bool = True,
excluded_extensions: set[str] | None = None,
) -> list[str]:
"""Return implemented extensions that have no selected tests."""
covered_extensions = {
extension for test_metadata in selected_tests.values() for extension in test_metadata.required_extensions
}
untested_extensions = implemented_extensions - covered_extensions
if not include_priv_tests:
untested_extensions -= PRIV_EXTENSIONS
if excluded_extensions:
untested_extensions -= excluded_extensions
return sorted(untested_extensions)
Loading