Move call target normalization into C tracer#413
Merged
Conversation
Owner
|
Thank you! |
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.
Addresses part of #115.
This moves the call target normalization currently done inside
TracingModule.trace_op()into the existing_crosshair_tracersC extension. The stack decoding remains incall_stack_info()from #410, while keyword normalization and replacement write-back stay in Python, so this keeps the behavior boundary small.What changed:
_crosshair_tracers.normalize_call_target()for the__self__/__call__/__func__/ type-level descriptor normalization path.TracingModule.trace_op()to call the C helper before handling keyword dictionaries andtrace_call().AttributeErrorpropagation during type-level lookup.This includes the error handling requested on #411: type-level lookup clears
AttributeError, but propagates other descriptor/access errors instead of continuing with an exception set.This intentionally does not touch the open CompositeTracer removal work in #409 or the opcode callback argument caching work in #412.
Verification:
python3 -m venv .venv && .venv/bin/python -m pip install --upgrade pip setuptools wheel && .venv/bin/python -m pip install --editable '.[dev]'.venv/bin/python setup.py build_ext --inplacePYTHONHASHSEED=0 .venv/bin/python -m pytest crosshair/tracers_test.py::test_normalize_call_target_helper_is_exported -qfailed before implementation as expected.PYTHONHASHSEED=0 .venv/bin/python -m pytest crosshair/tracers_test.py crosshair/_tracers_test.py -q->18 passedPYTHONHASHSEED=0 .venv/bin/python -m pytest crosshair/core_test.py crosshair/libimpl/builtinslib_test.py crosshair/tracers_test.py crosshair/_tracers_test.py -q->564 passed, 2 skippedCROSSHAIR_EXTRA_ASSERTS=1 PYTHONHASHSEED=0 .venv/bin/python -m pytest crosshair/core_test.py crosshair/libimpl/builtinslib_test.py crosshair/tracers_test.py crosshair/_tracers_test.py -q->564 passed, 2 skippedCROSSHAIR_EXTRA_ASSERTS=1 PYTHONHASHSEED=0 .venv/bin/python -m pytest -m smoke -n auto --dist worksteal crosshair -q->13 passed.venv/bin/python -m black --check crosshair/tracers.py crosshair/tracers_test.py.venv/bin/python -m isort --check-only crosshair/tracers.py crosshair/tracers_test.py.venv/bin/pre-commit run flake8 --files crosshair/tracers.py crosshair/tracers_test.pygit diff --checkI also attempted the full local xdist suite. It reported 8 failures in symbolic/time-sensitive areas under local parallel load; each failed nodeid that I reran in isolation passed with
PYTHONHASHSEED=0. I left this note here so CI remains the source of truth for the full matrix.