Repository navigation
luaengine: expose device state entries - #100
Conversation
Don't mix names and tags when exposing devices to LUA. While at it, also provide the shortname. Signed-off-by: Luca Bruno <lucab@debian.org>
Provide a Stack<UINT64> specialization for luabridge, later needed by some APIs. Signed-off-by: Luca Bruno <lucab@debian.org>
This commit exposes device_state_entry to LUA, providing methods to enumerate available states for a device object, as well as getting and setting their values. It is mostly usefull to inspect and manipulate registers content. Signed-off-by: Luca Bruno <lucab@debian.org>
luaengine: expose device state entries
|
It's buggy though. You need to call the pre- methods before reading state, OG. On Sun, Jan 11, 2015 at 10:43 AM, Miodrag Milanović <
|
|
@galibert sorry, I'm still getting used to mame core and may miss some details here and there. Thanks for patiently checking my PRs. I have some doubts after your last comment:
|
|
Don't worry, I don't understand all of it either. And I wrote the original For presave, you need to extract the pre-save part of I'm in the process of adding the device to the state_entry structure, and As for state_import/export it's used for the display and modification of Best, OG. On Sun, Jan 11, 2015 at 5:23 PM, Luca Bruno notifications@github.com
|
…vity (task mamedev#100) m_checkints_addrs (the sticky per-PC checkints-armed set, real production code, not diagnostic-gated) grows for the entire session with no clear()/bound anywhere - confirmed via a live gdb backtrace that its periodic bucket-array rehash (351,061 buckets by ~95s into boot) is a real ~11-13ms host-side stall, unrelated to the triggering compile's own instruction count and affecting every build, not just diagnostic runs. Mitigates the immediate tail-latency problem with a one-time reserve(1'000'000) on first insert (same pattern already proven on m_diag_usermode_recompile_counts this session), converting the periodic rehash stalls into one predictable upfront allocation. Verified: over_10ms_threshold dropped to 0 after this fix. Adds MAME_SGI_CHECKINTS_ARMED_FRACTION_DIAG to answer the follow-on architectural question directly rather than guess: is the per-PC sticky-set granularity buying real selectivity, or is checkints armed for most compiled PCs anyway? Measured 99.01% armed (333,568 of 336,918 distinct compiled PCs) - the granularity buys almost nothing, which favors reconsidering the whole mechanism over further optimizing its bookkeeping. Important caveat carried in this diagnostic's own comment: a blanket unconditional force was already tried once (2026-07-23) and caused a 100%-reproducible early-boot TLB miss/kernel fault, never root-caused - the 99% figure only weakens the selectivity argument for keeping this mechanism, it says nothing about whether that old structural bug is fixed. Diagnostic left enabled by deliberate choice while this scoping question stays open (see wiki/tasks.md task mamedev#100). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ostics (task mamedev#97) Built to answer a real question this project had only measured indirectly before: Bug B's own documented 373.9ms freeze (task mamedev#75, console.md) was correlated to a full drc_cache flush after the fact via two unrelated diagnostics, matched by timestamp - no direct instrument existed for "how much real host wall-clock time does a single compile/flush event cost" until now. This is a genuinely different axis from perf_ab_stats.sh's aggregate instructions/cycles comparison, which can't distinguish "374ms in one lump" from "374ms spread across many small pieces". MAME_SGI_STALL_DURATION_DIAG times execute_run()'s three code_compile_block()/code_flush_cache() call sites (including a third, previously-unattributed one inside code_compile_block()'s own abort_compilation retry, which regenerates the entire static handler set and was silently folding its cost into whatever compile call triggered it) with real std::chrono wall-clock reads, reporting per-event max/total and a count over a DoS-relevant threshold (10ms, matching the confirmed 100Hz guest tick period - tight enough to catch "could this discretely miss a transient real-world event", not just "would a human perceive a stutter"). MAME_SGI_COMPILE_LENGTH_CORRELATION_DIAG answers whether a long compile is a function of how far describe_code() had to traverse: tracks total opcode_desc count and describe_code()'s own share of each compile's duration, computing a Pearson correlation coefficient plus a log-scale duration histogram at clean exit. Investigation built on these two instruments found the real cause of this project's own ~11-13ms "long compile" outliers was periodic libstdc++ hash-table rehashing in two unbounded structures (m_diag_usermode_recompile_counts, fixed here with a one-time reserve(); m_checkints_addrs, spun off as task mamedev#100) - not compile length itself, which describe_code() timing directly ruled out (0.01-0.16% share of outlier ns). Both diagnostics disabled by default (non-trivial cost at ~1M compile events/boot) - a deliberate-measurement toggle, not left on for ordinary play, per their own header comments. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
These commits expose device_state_entry to LUA, providing methods
to enumerate available states for a device object, as well as getting
and setting their values. Mostly usefull to inspect and manipulate registers content.
Signed-off-by: Luca Bruno lucab@debian.org