Repository navigation
Use the configured time-context type in time() - #271
zimri-leisher merged 2 commits into
Conversation
| default_time_base = DEFAULT_TIME_BASE | ||
| # TIME and time() are shared by cached scopes. Restore this dictionary's | ||
| # context type even when _build_global_scopes returns a cached entry. | ||
| _update_time_context_type_from_dict(load_dictionary(dictionary)["type_defs"]) |
There was a problem hiding this comment.
this seems inconsistent with the rest of the code. instinct is telling me that we shouldn't have this here. my loose understanding is that there's a caching issue due to lru_cache, which causes multiple diff dictionaries loaded in same process to interfere with each other. can't you just reset the cache in the tests instead of this? in reality for the fprime-fpyc we never load two dicts, so it's not an "actual" problem, just one for tests
There was a problem hiding this comment.
then you can remove the extra tests for cache hit stuff
|
|
||
|
|
||
| @pytest.fixture | ||
| def context_dictionary(tmp_path): |
There was a problem hiding this comment.
can you please simplify this test code a bit? you're making quite a complex helper here, all you want to test is that for a given dictionary, we configure these various types and macros properly. so just make a couple dictionaries, hard coded is fine, and check that they work as expected
|
Thanks for the feedback. Updated in cabb756: I removed the production cache-switching behavior and cache-hit tests, The fixture now clears the caches and derived time defaults between tests, so each test starts with independent configuration state. I also replaced the dictionary factory and its path cache with four explicit U8/U16/U32/U64 configurations. The helper now just copies the reference dictionary and replaces its time-context type. |
* Update spelling action to fix fork PR checks (#270) Co-authored-by: Zakariya Ghazzol <[email protected]> * Test string layouts using the dictionary's FwSizeStoreType (#269) Co-authored-by: Zakariya Ghazzol <[email protected]> * Combine and update fprime submodule, remove WasmSeq patches (#284) * Consolidate harnesses * Switch to just one fprime submod * sp * Use the configured time-context type in time() (#271) * Use configured time-context types in time() * Simplify time-context tests and isolate cached state * 285 seq info tool (#286) * Add fprime-fpy-info sequence info tool * Output JSON from fprime-fpy-info --------- Co-authored-by: Zakariya Ghazzol <[email protected]> Co-authored-by: Zakariya Ghazzol <[email protected]>
* Update readme (#280) * Update spelling action to fix fork PR checks (#270) Co-authored-by: Zakariya Ghazzol <[email protected]> * Test string layouts using the dictionary's FwSizeStoreType (#269) Co-authored-by: Zakariya Ghazzol <[email protected]> * Combine and update fprime submodule, remove WasmSeq patches (#284) * Consolidate harnesses * Switch to just one fprime submod * sp * Use the configured time-context type in time() (#271) * Use configured time-context types in time() * Simplify time-context tests and isolate cached state * 285 seq info tool (#286) * Add fprime-fpy-info sequence info tool * Output JSON from fprime-fpy-info * Add source file information to the AST meta. (#290) * Add file path to AST meta information * Strengthen test_directives_record_originating_file * Change meta.file -> meta.file_name to be consistent with error.file_name. However, it should be noted that both of these are file paths, not names --------- Co-authored-by: Bill Eggert <[email protected]> * Add a source map to compile_to_fpybin and fprime-fpyc (#292) * Add a source map to compile_to_fpybin and fprime-fpyc --source-map * Format FpybinCompile with black * Map directives a block generates for itself to no source line * smap -> source_map, to satisfy the spellchecker --------- Co-authored-by: Bill Eggert <[email protected]> --------- Co-authored-by: Zakariya Ghazzol <[email protected]> Co-authored-by: Zakariya Ghazzol <[email protected]> Co-authored-by: weggert2 <[email protected]> Co-authored-by: Bill Eggert <[email protected]>
Fixes #221.
Summary
time()argument, its zero default, and the returned constant.Regression coverage checks configured types/defaults, exact serialized bytes, integer limits, and compilation for both backends. Runtime cases exercise default, explicit, and maximum contexts on both reference-configured sequencers.
Validation
--check --target-version py310) andgit diff --checkpassed.Local runtime tests reused the existing real bytecode and Wasm C++ harness binaries after verifying their hashes, harness sources, and submodule revisions; this revision did not rebuild the native harnesses. The previously supplied Wasm harness compatibility patch remains local and is excluded from this PR.
No dependency, workflow, submodule, or runtime-configuration changes are included.