Measure frame hitches and calibrate graphics for the current environment
This commit is contained in:
parent
15bd159cf6
commit
10aa3700e3
@ -1,4 +1,4 @@
|
||||
Ruen UI - ESDF key map (2026.11.21.8-beta.1)
|
||||
Ruen UI - ESDF key map (2026.11.22.1-beta.1)
|
||||
|
||||
MOVEMENT
|
||||
Q W [E] R T
|
||||
@ -156,9 +156,14 @@ languages must be downloaded through Battle.net. See docs/INSTALL.md for command
|
||||
|
||||
TIMERS AND OPTIMIZATION
|
||||
/ruen swing on|off|preview
|
||||
/ruen optimize [world|raid|pause|resume|status|restore]
|
||||
/ruen optimize [FPS] — measure/tune the current area; 60 by default, then remembers your target.
|
||||
/ruen optimize [world|dungeon|raid|battleground] [FPS]
|
||||
/ruen optimize pause|resume|status|restore
|
||||
/ruen bench [pause|resume|stop|status] — every-frame timings, worst hitch and 1% low.
|
||||
Hardware evaluation: Ruen-Setup.exe --optimize (Windows), ./Ruen-Setup --optimize (Linux).
|
||||
See docs/INSTALL.md for the measured world/raid calibration workflow.
|
||||
See docs/INSTALL.md. Keep WoW focused during measurement; pause before switching apps.
|
||||
World, dungeon, raid and battleground profiles learn separately. Run optimize again
|
||||
in a troublesome area. Settings change outside combat; there is no idle sampling.
|
||||
|
||||
CLASS ASSIST COMMANDS (no new keybindings)
|
||||
/ruen cooldowns auto|show|hide|off|settings — native class cooldown/buff displays.
|
||||
|
||||
@ -4,7 +4,7 @@ A compact, class-aware **WoW: Forever** interface with ESDF controls, English/Ru
|
||||
|
||||
**[Download the beta](https://scm.bstein.dev/bstein/ruen-ui/releases)** · **[Windows installation](docs/INSTALL.md)** · **[Инструкция на русском](docs/INSTALL-RU.md)** · **[Release review](docs/RELEASE-REVIEW.md)** · **[Report a problem](https://scm.bstein.dev/bstein/ruen-ui/issues)**
|
||||
|
||||
Choose **Ruen-UI-2026.11.21.8-beta.1.zip** under release assets, not Gitea's automatic source ZIP. No account is needed to download. The download is small; setup then retrieves the selected companion addons directly from their authors.
|
||||
Choose **Ruen-UI-2026.11.22.1-beta.1.zip** under release assets, not Gitea's automatic source ZIP. No account is needed to download. The download is small; setup then retrieves the selected companion addons directly from their authors.
|
||||
|
||||
## Windows quick start
|
||||
|
||||
@ -24,7 +24,7 @@ Ruen changes movement to **E forward, D backward, S/F strafe**. Turn using the r
|
||||
- Layout rules for bags, tooltips, notifications, party/raid frames and native damage meters. Meters appear automatically in dungeons and raids; `/ruen meters off` disables them.
|
||||
- Optional native cooldown displays and role-based defaults for mouseover casting. Cooldown coverage comes from the game; it is not an exhaustive tracker for every learned spell.
|
||||
- Spoken quest narration with English or English + Russian recordings. Game text and spoken language files must be installed separately through Battle.net.
|
||||
- Optional graphics calibration for world/raid play, with a configurable FPS target. Hardware reports are generated on the destination PC; no donor hardware profile is shipped.
|
||||
- On-demand graphics calibration for world/dungeon/raid/battleground play, with a configurable FPS target and explicit hitch checks. Hardware reports are generated on the destination PC; no donor hardware profile is shipped.
|
||||
- Gun Silencer Forever integration, default replacement volume **100**. Its softer shot is still a gunshot. **Nearby original gunfire is muted while enabled**; `/ruen guns off` restores native audio.
|
||||
|
||||
The installer downloads Leatrix Plus, Leatrix Maps, Spoken, Gun Silencer Forever and your chosen narration packs from pinned upstream releases. Existing Forever-compatible copies and saved settings are retained. See [dependencies and licenses](docs/DEPENDENCIES.md).
|
||||
@ -35,7 +35,7 @@ See the [staged update checklist](docs/UPDATE-PLAN.md) for implementation and re
|
||||
|
||||
Installer transaction tests, Lua regressions, source review and local gameplay checks inform this release. The user verified the beta8 pet selected-state fix in game across native and extra stance buttons. **A clean native Windows installation and every class/spec in live raids have not been verified.** Automated layout simulations are not a guarantee against every possible addon or window combination. See the [release review](docs/RELEASE-REVIEW.md) for the tested scope and remaining limitations.
|
||||
|
||||
A focused local follow-up showed worse low-FPS readings than the baseline; performance verification remains open. `/ruen bench` now includes native addon CPU diagnostics to help identify the cause.
|
||||
A focused local follow-up showed worse low-FPS readings than the baseline; performance verification remains open. `/ruen bench` now records every gameplay frame, brief hitches, worst-frame time and slowest-1% FPS, plus native addon CPU diagnostics. `/ruen optimize 60` retunes the area you are playing in; use `30` for a lower target. See the [measurement workflow](docs/INSTALL.md#optional-optimization).
|
||||
|
||||
Ruen does not install graphics drivers, change GPU drivers, or install a background service. Its optimizer cannot guarantee temperatures or sustained FPS on every laptop.
|
||||
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
local _, P = ...
|
||||
-- Read the client's already-running profiler only during /ruen bench. No
|
||||
-- scriptProfile toggle, extra ticker, frame hooks, graphics edits or idle work.
|
||||
-- Read the client's already-running profiler only during /ruen bench.
|
||||
-- Frame recording is bounded and manual; no scriptProfile or graphics edits.
|
||||
local fields = {"gxApi", "gxAdapter", "RenderScale", "maxFPS", "maxFPSBk", "vsync",
|
||||
"useTargetFPS", "graphicsShadowQuality", "graphicsSSAO", "graphicsViewDistance",
|
||||
"graphicsEnvironmentDetail", "graphicsGroundClutter", "graphicsComputeEffects"}
|
||||
"graphicsEnvironmentDetail", "graphicsGroundClutter", "graphicsComputeEffects",
|
||||
"graphicsLightMode", "graphicsPBRLiquidDetail", "graphicsLiquidDetail", "RAIDsettingsEnabled",
|
||||
"graphicsParticleDensity", "graphicsSpellDensity", "graphicsProjectedTextures",
|
||||
"graphicsDepthEffects", "graphicsTextureResolution", "MSAAQuality", "msaaAlphaTest", "ffxAntiAliasingMode"}
|
||||
local counters = {"CountTimeOver1Ms", "CountTimeOver5Ms", "CountTimeOver10Ms", "CountTimeOver50Ms"}
|
||||
|
||||
local function number(fn, ...)
|
||||
@ -22,7 +25,7 @@ local function settings()
|
||||
local optimizer = RuenUIDB.optimizer
|
||||
if optimizer then
|
||||
result.calibrationEnabled = optimizer.enabled
|
||||
for _, mode in ipairs({"world", "raid"}) do
|
||||
for _, mode in ipairs({"world", "dungeon", "raid", "battleground"}) do
|
||||
local profile = optimizer.profiles and optimizer.profiles[mode]
|
||||
if profile then result[mode.."Tier"] = profile.tier; result[mode.."Calibrated"] = profile.calibrated end
|
||||
end
|
||||
@ -46,20 +49,93 @@ function P.StartBenchmarkDiagnostics()
|
||||
return data
|
||||
end
|
||||
|
||||
function P.SampleBenchmarkDiagnostics(data, fps)
|
||||
function P.SampleBenchmarkDiagnostics(data, fps, worstMS)
|
||||
if #data.samples >= 180 then return end
|
||||
local row = {fps=fps, ruenRecentMS=metric("RecentAverageTime")}
|
||||
local row = {fps=fps, worstFrameMS=worstMS, ruenRecentMS=metric("RecentAverageTime")}
|
||||
if row.ruenRecentMS ~= nil and C_AddOnProfiler.GetOverallMetric then
|
||||
row.allAddonsRecentMS = number(C_AddOnProfiler.GetOverallMetric, Enum.AddOnProfilerMetric.RecentAverageTime)
|
||||
end
|
||||
-- Keep the relevant neighbors on slow readings, not a scan of every addon.
|
||||
if fps < 30 and row.ruenRecentMS ~= nil and C_AddOnProfiler.GetTopKAddOnsForMetric then
|
||||
if (fps < 30 or (worstMS or 0) > 50) and row.ruenRecentMS ~= nil and C_AddOnProfiler.GetTopKAddOnsForMetric then
|
||||
local ok, top = pcall(C_AddOnProfiler.GetTopKAddOnsForMetric, Enum.AddOnProfilerMetric.RecentAverageTime, 3)
|
||||
if ok and type(top) == "table" then row.topAddons = top end
|
||||
end
|
||||
data.samples[#data.samples+1] = row
|
||||
end
|
||||
|
||||
local frame, capture
|
||||
local function say(en, ru) print('|cff60d5ffRuen UI:|r '..P.Localized(en,ru or en)) end
|
||||
function P.IsBenchmarkRunning() return capture ~= nil end
|
||||
local function finishCapture(partial)
|
||||
local c=capture
|
||||
frame:SetScript('OnUpdate',nil); capture=nil
|
||||
local r=P.FrameSampleSummary(c.sample)
|
||||
r.time=time(); r.partial=partial or nil; r.diagnostics=c.diagnostics
|
||||
r.excludedLoadingSeconds=c.excluded; r.focusVerified=false
|
||||
r.note='Gameplay OnUpdate intervals; 1% low is reciprocal of mean slowest 1% frame time (0.25 ms bins). Loading excluded; window focus unverified.'
|
||||
local cpuMessage=P.FinishBenchmarkDiagnostics(c.diagnostics)
|
||||
RuenUIDB.reports=RuenUIDB.reports or {}
|
||||
table.insert(RuenUIDB.reports,r)
|
||||
while #RuenUIDB.reports>5 do table.remove(RuenUIDB.reports,1) end
|
||||
if r.frames>0 then
|
||||
say(('Frame bench%s: %.1f FPS avg; 1%% low %.1f FPS; p99 %.1f ms; worst %.1f ms. Frames >50/>100/>250 ms: %d/%d/%d over %.1f s.'):format(
|
||||
partial and ' (partial)' or '',r.meanFPS,r.low1FPS,r.p99MS,r.worstMS,r.over50,r.over100,r.over250,r.seconds),
|
||||
('Замер кадров%s: среднее %.1f FPS; 1%% low %.1f FPS; p99 %.1f мс; максимум %.1f мс. Кадров >50/>100/>250 мс: %d/%d/%d за %.1f с.'):format(
|
||||
partial and ' (неполный)' or '',r.meanFPS,r.low1FPS,r.p99MS,r.worstMS,r.over50,r.over100,r.over250,r.seconds))
|
||||
if r.histogramClipped then say('A stall exceeded 10 seconds: histogram percentiles are capped; worst-frame time is exact.') end
|
||||
else say('Benchmark stopped without gameplay frames.','Замер остановлен без игровых кадров.') end
|
||||
say(cpuMessage)
|
||||
say('Saved on logout/reload. Loading is excluded; app switching is NOT detected. These frame times cannot identify network lag or prove GPU/thermal causes.',
|
||||
'Сохранится при выходе или /reload. Загрузка исключена; переключение окон НЕ определяется. Замер не устанавливает причину сетевых задержек или перегрева.')
|
||||
if P.OptimizerBenchmarkEnded then P.OptimizerBenchmarkEnded() end
|
||||
end
|
||||
local function update(_,dt)
|
||||
local c=capture
|
||||
if not c then return end
|
||||
if c.paused then return end
|
||||
if c.loading or c.settle>0 then
|
||||
c.excluded=c.excluded+dt; c.settle=math.max(0,c.settle-dt); return
|
||||
end
|
||||
P.AddFrameSample(c.sample,dt)
|
||||
c.interval=c.interval+dt; c.worst=math.max(c.worst,dt*1000)
|
||||
if c.interval>=1 then
|
||||
P.SampleBenchmarkDiagnostics(c.diagnostics,GetFramerate(),c.worst)
|
||||
c.interval=0; c.worst=0
|
||||
end
|
||||
if c.sample.seconds>=180 then finishCapture() end
|
||||
end
|
||||
function P.BenchmarkCommand(arg)
|
||||
arg=arg or ''
|
||||
if arg=='status' then
|
||||
say(capture and ('Benchmark '..(capture.paused and 'paused' or 'running')..': '..math.floor(capture.sample.seconds)..'/180 seconds recorded.') or 'No benchmark running.'); return
|
||||
elseif arg=='stop' then
|
||||
if capture then finishCapture(true) else say('No benchmark running.') end; return
|
||||
elseif arg=='pause' or arg=='resume' then
|
||||
if not capture then say('No benchmark running.'); return end
|
||||
capture.paused=arg=='pause'; capture.settle=1
|
||||
say(capture.paused and 'Benchmark paused.' or 'Benchmark resumed; keep WoW focused.'); return
|
||||
elseif arg~='' then say('/ruen bench [pause|resume|stop|status]'); return end
|
||||
if capture then say('A benchmark is already running.'); return end
|
||||
if P.IsOptimizerCalibrating and P.IsOptimizerCalibrating() then
|
||||
say('Let optimization finish, or /ruen optimize pause, before benchmarking.',
|
||||
'Дождитесь окончания настройки или /ruen optimize pause перед замером.'); return
|
||||
end
|
||||
if not frame then
|
||||
frame=CreateFrame('Frame')
|
||||
frame:RegisterEvent('PLAYER_LEAVING_WORLD'); frame:RegisterEvent('PLAYER_ENTERING_WORLD')
|
||||
frame:SetScript('OnEvent',function(_,event)
|
||||
if capture then
|
||||
capture.loading=event=='PLAYER_LEAVING_WORLD'; capture.settle=2
|
||||
capture.sample.inHitch=false
|
||||
end
|
||||
end)
|
||||
end
|
||||
capture={sample=P.NewFrameSample(),diagnostics=P.StartBenchmarkDiagnostics(),interval=0,worst=0,excluded=0,settle=1}
|
||||
frame:SetScript('OnUpdate',update)
|
||||
say('Recording every gameplay frame for 3 minutes, including brief hitches. Keep WoW focused; /ruen bench pause before switching apps. No graphics changes.',
|
||||
'Запись каждого кадра в течение 3 минут, включая короткие рывки. Не переключайте окно; перед переключением /ruen bench pause. Графика не изменяется.')
|
||||
end
|
||||
|
||||
function P.FinishBenchmarkDiagnostics(data)
|
||||
data.settingsEnd = settings()
|
||||
data.settingsChanged = false
|
||||
@ -81,7 +157,7 @@ function P.FinishBenchmarkDiagnostics(data)
|
||||
local before, after = data.countersStart[name], metric(name)
|
||||
if before ~= nil and after ~= nil and after >= before then data.ticksOver[name] = after-before end
|
||||
end
|
||||
data.note = "Native recent metrics average the last 60 ticks; sampled once/second. Threshold deltas cover this benchmark, not the whole login."
|
||||
data.note = "Native recent metrics average the last 60 ticks; sampled about once/second. Threshold deltas cover this run's wall time (including pause/loading), not the whole login. Slow-frame correlation is not proof of causation."
|
||||
local message
|
||||
if data.sampledMeanMS then
|
||||
local slow = data.ticksOver.CountTimeOver5Ms
|
||||
|
||||
@ -114,7 +114,7 @@ function P.Help()
|
||||
say(P.Localized("/ruen meters auto|show|off: native damage/healing meter; auto shows in dungeons and raids.",
|
||||
"/ruen meters auto|show|off: встроенный счётчик урона/исцеления; auto — в подземельях и рейдах."))
|
||||
say(P.Localized("Alt now selects action buttons. Automatic self-cast stays on; use F1 to target yourself. Ctrl+Shift+F11 hides/shows the UI.", "Alt выбирает кнопки действий. Автовыбор себя включён; F1 — выбрать себя. Ctrl+Shift+F11 скрывает интерфейс."))
|
||||
say(P.Localized("/ruen optimize: measure world/raid performance. optimize pause|resume|status|restore. Hardware check: bundled Optimize tool.","/ruen optimize: проверка мира/рейда. optimize pause|resume|status|restore. Датчики: утилита Optimize из комплекта."))
|
||||
say(P.Localized("/ruen optimize [FPS]: retune this area (default 60 or your saved target). optimize pause|resume|status|restore. /ruen bench: frame times and hitches.","/ruen optimize [FPS]: настройка текущей зоны (60 или сохранённая цель). optimize pause|resume|status|restore. /ruen bench: время кадров и рывки."))
|
||||
say(P.Localized("/ruen swing on|off|preview: thin attack timers. /ruen lock | unlock: lock or drag action and pet abilities normally outside combat.",
|
||||
"/ruen swing on|off|preview: таймеры атак. /ruen unlock: свободное перемещение способностей, включая питомца, вне боя."))
|
||||
say("Grave (`): autorun, added only if the key was unbound.")
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
local _, P = ...
|
||||
local frame = CreateFrame("Frame")
|
||||
local ticker
|
||||
local function say(s) print("|cff60d5ffRuen UI:|r " .. P.Translate(s)) end
|
||||
local function init()
|
||||
RuenUIDB = RuenUIDB or {original = {}, reports = {}}
|
||||
@ -992,30 +991,6 @@ local function restore()
|
||||
say("Original settings restored for this character; automatic setup disabled account-wide. The extra saved layout is retained for reuse.")
|
||||
if addonRestore then say("Type /reload once to finish restoring addon preferences.") end
|
||||
end
|
||||
local function bench()
|
||||
if ticker then say("An FPS sample is already running."); return end
|
||||
local samples, total, below = {}, 0, 0
|
||||
local diagnostics = P.StartBenchmarkDiagnostics()
|
||||
say("Sampling FPS once per second for 3 minutes. Play normally and keep WoW focused.")
|
||||
ticker = C_Timer.NewTicker(1, function()
|
||||
local fps = GetFramerate()
|
||||
samples[#samples + 1] = fps; total = total + fps
|
||||
if fps < 30 then below = below + 1 end
|
||||
P.SampleBenchmarkDiagnostics(diagnostics, fps)
|
||||
if #samples == 180 then
|
||||
ticker:Cancel(); ticker = nil
|
||||
table.sort(samples)
|
||||
local r = {time = time(), count = 180, mean = total / 180, minimum = samples[1], p10 = samples[18], below30 = below, note = "1-second FPS readings, not a per-frame 1% low"}
|
||||
local cpuMessage = P.FinishBenchmarkDiagnostics(diagnostics)
|
||||
r.diagnostics = diagnostics
|
||||
local reports = RuenUIDB.reports
|
||||
reports[#reports + 1] = r
|
||||
while #reports > 5 do table.remove(reports, 1) end
|
||||
say(string.format("FPS sample: avg %.1f, minimum %.1f, 10th percentile %.1f; %d/180 readings below 30. Saved on logout/reload.", r.mean, r.minimum, r.p10, below))
|
||||
say(cpuMessage)
|
||||
end
|
||||
end)
|
||||
end
|
||||
SLASH_RUENUI1 = "/ruen"
|
||||
SLASH_RUENUI2 = "/ruenui"
|
||||
SlashCmdList.RUENUI = function(message)
|
||||
@ -1033,6 +1008,7 @@ SlashCmdList.RUENUI = function(message)
|
||||
return
|
||||
elseif command == "meters" then say(P.DamageMeterCommand(argument)); return
|
||||
elseif command == "optimize" then P.OptimizerCommand(argument); return
|
||||
elseif command == "bench" then P.BenchmarkCommand(argument); return
|
||||
elseif message == "swing" or message:match("^swing%s") then
|
||||
say(P.SwingCommand(message:match("^swing%s+(%S+)") or "status")); return
|
||||
end
|
||||
@ -1057,7 +1033,6 @@ SlashCmdList.RUENUI = function(message)
|
||||
end
|
||||
if message == "apply" then RuenUIDB.disabled = nil; apply(true)
|
||||
elseif message == "restore" then restore()
|
||||
elseif message == "bench" then bench()
|
||||
elseif message == "status" then recordLayoutStatus(true); say(P.CharacterProfileSummary())
|
||||
elseif message == "balanced" or message == "performance" then
|
||||
if InCombatLockdown() then say("Leave combat before changing graphics."); return end
|
||||
|
||||
45
RuenUI/FrameTiming.lua
Normal file
45
RuenUI/FrameTiming.lua
Normal file
@ -0,0 +1,45 @@
|
||||
local _, P = ...
|
||||
-- Bounded histograms shared by the two explicit measurements. No timers, API
|
||||
-- queries, sorting, or per-frame table allocations in the recording path.
|
||||
local scale, lastBin = 4000, 40000 -- quarter-millisecond bins, through ten seconds
|
||||
function P.NewFrameSample()
|
||||
return {bins={}, frames=0, seconds=0, worstMS=0, over50=0, over100=0, over250=0, hitchEpisodes=0}
|
||||
end
|
||||
function P.AddFrameSample(s, dt)
|
||||
if type(dt) ~= 'number' or dt <= 0 or dt ~= dt or dt == math.huge then return end
|
||||
local bin = math.min(lastBin, math.ceil(dt * scale))
|
||||
s.bins[bin] = (s.bins[bin] or 0) + 1
|
||||
s.frames = s.frames + 1; s.seconds = s.seconds + dt
|
||||
local ms = dt * 1000
|
||||
if ms > s.worstMS then s.worstMS = ms end
|
||||
if ms > 50 then
|
||||
s.over50 = s.over50 + 1
|
||||
if not s.inHitch then s.hitchEpisodes = s.hitchEpisodes + 1 end
|
||||
end
|
||||
s.inHitch = ms > 50
|
||||
if ms > 100 then s.over100 = s.over100 + 1 end
|
||||
if ms > 250 then s.over250 = s.over250 + 1 end
|
||||
end
|
||||
function P.FrameSampleSummary(s)
|
||||
local r = {frames=s.frames, seconds=s.seconds, worstMS=s.worstMS,
|
||||
over50=s.over50, over100=s.over100, over250=s.over250, hitchEpisodes=s.hitchEpisodes}
|
||||
if s.frames == 0 then return r end
|
||||
r.meanFPS = s.frames / s.seconds
|
||||
local count = 0
|
||||
for bin=1,lastBin do
|
||||
count = count + (s.bins[bin] or 0)
|
||||
if not r.p90MS and count >= math.ceil(s.frames * .90) then r.p90MS = bin / 4 end
|
||||
if count >= math.ceil(s.frames * .99) then r.p99MS = bin / 4; break end
|
||||
end
|
||||
-- Mean of the slowest 1% of frames, explicitly different from p99.
|
||||
local remaining, tailMS = math.max(1, math.ceil(s.frames * .01)), 0
|
||||
local tailCount = remaining
|
||||
for bin=lastBin,1,-1 do
|
||||
local n = math.min(remaining, s.bins[bin] or 0)
|
||||
tailMS = tailMS + n * bin / 4; remaining = remaining - n
|
||||
if remaining == 0 then break end
|
||||
end
|
||||
r.low1FPS = 1000 / (tailMS / tailCount)
|
||||
r.histogramClipped = s.worstMS > 10000
|
||||
return r
|
||||
end
|
||||
@ -1,236 +1,282 @@
|
||||
local _, P = ...
|
||||
-- Bounded, opt-in frame-time calibration. Hardware telemetry comes from the
|
||||
-- companion, never from a guess based on FPS. No resolution/API/fan/voltage edits.
|
||||
local f, run, pending, context, warmup, elapsed, frames, histogram, windows, good, pendingLoad
|
||||
local function say(en,ru) print('|cff60d5ffRuen UI:|r '..P.Localized(en,ru or en)) end
|
||||
-- Explicit, bounded scene calibration. No idle polling after a profile settles.
|
||||
-- Graphics are reversible; hardware/thermal evidence is supplied by the companion.
|
||||
local f, running, session, pendingLoad, loading, deferredEnvironment
|
||||
local modes = {'world', 'dungeon', 'raid', 'battleground'}
|
||||
local function say(en, ru) print('|cff60d5ffRuen UI:|r '..P.Localized(en, ru or en)) end
|
||||
local function validFPS(value)
|
||||
local n = tonumber(value)
|
||||
if n and n >= 20 and n <= 240 and n == math.floor(n) then return n end
|
||||
end
|
||||
local function db()
|
||||
RuenUIDB.optimizer=RuenUIDB.optimizer or {original={},profiles={}}
|
||||
return RuenUIDB.optimizer
|
||||
RuenUIDB.optimizer = RuenUIDB.optimizer or {original={}, profiles={}}
|
||||
local d = RuenUIDB.optimizer
|
||||
d.original = d.original or {}; d.profiles = d.profiles or {}
|
||||
for _, name in ipairs(modes) do d.profiles[name] = d.profiles[name] or {tier=1} end
|
||||
return d
|
||||
end
|
||||
local function targetFPS(value)
|
||||
local n=tonumber(value)
|
||||
if n and n>=20 and n<=240 and n==math.floor(n) then return n end
|
||||
return 60
|
||||
end
|
||||
local tiers={
|
||||
{0,0,1,1,1,1,1}, {1,0,2,2,2,2,1}, {2,1,3,3,3,2,2},
|
||||
{2,1,5,5,4,3,2}, {3,2,7,6,5,3,3},
|
||||
}
|
||||
local fields={'ShadowQuality','SSAO','ViewDistance','EnvironmentDetail','GroundClutter','LiquidDetail','ComputeEffects'}
|
||||
local function mode()
|
||||
local inside,kind=IsInInstance()
|
||||
if inside and (kind=='raid' or kind=='pvp') then return 'raid' end
|
||||
if not inside then return 'world' end
|
||||
return nil -- a dungeon is not evidence for open-world or raid calibration
|
||||
local inside, kind = IsInInstance()
|
||||
if inside and kind == 'raid' then return 'raid' end
|
||||
if inside and (kind == 'pvp' or kind == 'arena') then return 'battleground' end
|
||||
if inside then return 'dungeon' end
|
||||
return 'world'
|
||||
end
|
||||
local function fingerprint()
|
||||
local w,h=GetPhysicalScreenSize()
|
||||
local w,h = GetPhysicalScreenSize()
|
||||
return w..'x'..h..':'..(C_CVar.GetCVar('gxAdapter') or '')..':'..(C_CVar.GetCVar('gxApi') or '')
|
||||
end
|
||||
local function hardware()
|
||||
local h=P.hardwareProfile or {}
|
||||
if not h.checkedAt or time()-h.checkedAt>604800 or time()<h.checkedAt then return {} end
|
||||
local h = P.hardwareProfile or {}
|
||||
if not h.checkedAt or time()-h.checkedAt > 604800 or time() < h.checkedAt then return {} end
|
||||
return h
|
||||
end
|
||||
local function write(key,value,raid)
|
||||
local d=db();local before=C_CVar.GetCVar(key)
|
||||
if before==nil then return false end
|
||||
if key:find('Graphics') or key:find('^graphics') then
|
||||
local reason=IsGraphicsSettingValueSupported and IsGraphicsSettingValueSupported(key,value,raid or false)
|
||||
if reason and reason~=0 then return false end
|
||||
local fields = {'ShadowQuality','SSAO','ViewDistance','EnvironmentDetail','GroundClutter',
|
||||
'LiquidDetail','ComputeEffects','LightMode','PBRLiquidDetail'}
|
||||
local tiers = {
|
||||
{0,0,1,1,1,0,0,0,0}, {1,0,2,2,2,1,1,0,0}, {2,1,3,3,3,2,2,1,0},
|
||||
{2,1,5,5,4,3,2,1,1}, {3,2,7,6,5,3,3,2,1},
|
||||
}
|
||||
local function write(key, value)
|
||||
local before = C_CVar.GetCVar(key)
|
||||
if before == nil then return false end
|
||||
if key:find('^graphics') and IsGraphicsSettingValueSupported then
|
||||
local ok, reason = pcall(IsGraphicsSettingValueSupported, key, value, false)
|
||||
if not ok or (reason and reason ~= 0) then return false end
|
||||
end
|
||||
if d.original[key]==nil then d.original[key]=before end
|
||||
if before==tostring(value) then return true end
|
||||
local ok=pcall(C_CVar.SetCVar,key,tostring(value))
|
||||
return ok
|
||||
if before == tostring(value) then return true end
|
||||
local d = db()
|
||||
if d.original[key] == nil then d.original[key] = before end
|
||||
local ok = pcall(C_CVar.SetCVar, key, tostring(value))
|
||||
if not ok then return false end
|
||||
return tostring(C_CVar.GetCVar(key)) == tostring(value)
|
||||
end
|
||||
local function profile(which,tier)
|
||||
local prefix=which=='raid' and 'raidGraphics' or 'graphics'
|
||||
for i,suffix in ipairs(fields) do write(prefix..suffix,tiers[tier][i],which=='raid') end
|
||||
-- Preserve readable surfaces, full-size UI and ground telegraphs.
|
||||
write(prefix..'ProjectedTextures',1,which=='raid')
|
||||
write(prefix..'ParticleDensity',2,which=='raid')
|
||||
write(prefix..'SpellDensity',which=='raid' and 0 or 1,which=='raid')
|
||||
write(prefix..'DepthEffects',0,which=='raid')
|
||||
local function profile(tier)
|
||||
local failures = {}
|
||||
tier = math.max(1, math.min(#tiers, tier or 1))
|
||||
-- Own environment switching explicitly: the native raid preset must not
|
||||
-- silently replace the settings being measured in a dungeon/BG/raid.
|
||||
if not write('RAIDsettingsEnabled', 0) then failures.RAIDsettingsEnabled = true end
|
||||
for i, suffix in ipairs(fields) do
|
||||
local key = 'graphics'..suffix
|
||||
if not write(key, tiers[tier][i]) then failures[key] = true end
|
||||
end
|
||||
for key, value in pairs({graphicsProjectedTextures=1, graphicsParticleDensity=2,
|
||||
graphicsSpellDensity=0, graphicsDepthEffects=0}) do
|
||||
if not write(key, value) then failures[key] = true end
|
||||
end
|
||||
-- Keep render scale, texture resolution and UI scale as the player chose.
|
||||
-- These low-cost AA choices take effect without replacing GPU/API/drivers.
|
||||
write('MSAAQuality', '0,0'); write('msaaAlphaTest', 0)
|
||||
write('ffxAntiAliasingMode', 1); write('vsync', 0); write('useTargetFPS', 0)
|
||||
return failures
|
||||
end
|
||||
local function cap(value)
|
||||
write('useMaxFPS',1);write('maxFPS',value)
|
||||
write('useMaxFPSBk',1);write('maxFPSBk',15)
|
||||
write('useMaxFPS', 1); write('maxFPS', value)
|
||||
end
|
||||
local function reset(seconds)
|
||||
warmup,elapsed,frames,histogram=seconds or 15,0,0,{}
|
||||
local function resetSample(seconds)
|
||||
if session then session.sample=P.NewFrameSample(); session.warmup=seconds or 8 end
|
||||
end
|
||||
local function percent(p)
|
||||
local count=0
|
||||
for tenthMS=1,20000 do
|
||||
count=count+(histogram[tenthMS] or 0)
|
||||
if count>=frames*p then return 10000/tenthMS end
|
||||
local function applyTier(tier, phase)
|
||||
local s, d = session, db()
|
||||
s.tier=tier; s.phase=phase or 'search'; s.pending=nil; s.good=0
|
||||
s.unsupported=profile(tier)
|
||||
cap(s.phase == 'validate' and d.target or math.ceil(d.target * 1.1))
|
||||
resetSample(8)
|
||||
end
|
||||
local function passed(r, target, validate)
|
||||
-- Tail latency and explicit hitches matter even when 99% of frames are fast.
|
||||
-- At most one >50ms frame per 20s, and no >100ms frame, passes this window.
|
||||
return r.frames > 0 and 1000/r.p90MS >= target * (validate and .95 or 1.02)
|
||||
and 1000/r.p99MS >= target * .80 and r.over100 == 0
|
||||
and r.over50 <= math.floor(r.seconds / 20 + .01)
|
||||
end
|
||||
local function finish(r)
|
||||
local s, d = session, db()
|
||||
local saved = d.profiles[s.mode]
|
||||
saved.tier=s.tier; saved.calibrated=true; saved.fingerprint=fingerprint(); saved.time=time()
|
||||
saved.revision=2; saved.metTarget=passed(r,d.target,true); saved.last=r
|
||||
saved.history=s.history; saved.unsupported=s.unsupported
|
||||
saved.zone=GetRealZoneText and GetRealZoneText() or nil
|
||||
saved.subzone=GetSubZoneText and GetSubZoneText() or nil
|
||||
saved.requestedFPS=d.requestedFPS
|
||||
cap(d.target)
|
||||
say(('Graphics %s: tier %d/5 saved at %d FPS. p99 %.1f ms; worst %.1f ms; >100 ms frames: %d. %s'):format(
|
||||
s.mode, s.tier, d.target, r.p99MS or 0, r.worstMS, r.over100,
|
||||
saved.metTarget and 'Smoothness checks passed in this sample.' or 'Target/smoothness NOT met. Settings alone may not resolve these stalls.'),
|
||||
('Графика %s: уровень %d/5, цель %d FPS. p99 %.1f мс; максимум %.1f мс; кадров >100 мс: %d. %s'):format(
|
||||
s.mode, s.tier, d.target, r.p99MS or 0, r.worstMS, r.over100,
|
||||
saved.metTarget and 'Проверка плавности пройдена для этого замера.' or 'Цель НЕ достигнута. Настройки графики могут не устранить задержки.'))
|
||||
if next(s.unsupported) then
|
||||
say('Some graphics controls are unavailable on this client/GPU; the result measures the settings actually accepted.',
|
||||
'Некоторые настройки недоступны; результат получен с фактически применёнными значениями.')
|
||||
end
|
||||
return 0
|
||||
end
|
||||
local function finish()
|
||||
local d=db(); local r=d.profiles[context]
|
||||
profile(context,r.best or 1);r.tier=r.best or 1;r.calibrated=true;r.fingerprint=fingerprint();r.time=time()
|
||||
r.metTarget=r.best~=nil
|
||||
pending=nil;cap(d.target)
|
||||
say(('Graphics %s: tier %d/5 saved; %d FPS cap. %s'):format(context,r.tier,d.target,
|
||||
r.metTarget and 'Measured headroom passed.' or 'Target not sustained at the lowest tier; this profile is a compromise.'),
|
||||
('Графика %s: уровень %d/5, лимит %d FPS. %s'):format(context,r.tier,d.target,
|
||||
r.metTarget and 'Запас производительности подтверждён.' or 'Минимальные настройки не обеспечили целевую частоту кадров.'))
|
||||
context=nil;reset(30)
|
||||
f:SetScript("OnUpdate",nil) -- sleep until an environment/resolution event
|
||||
session=nil; f:SetScript('OnUpdate',nil)
|
||||
end
|
||||
local function commit()
|
||||
if not run or InCombatLockdown() or not pending then return end
|
||||
if mode()~=context then pending=nil;context=nil;cap(db().target);reset(30);return end
|
||||
local r=db().profiles[context]
|
||||
if pending=='finish' then finish();return end
|
||||
r.tier=pending;pending=nil;profile(context,r.tier);reset(15)
|
||||
local s = session
|
||||
if not s or not s.pending or InCombatLockdown() or loading then return end
|
||||
if s.pending == 'finish' then finish(s.last)
|
||||
else local nextStep=s.pending; applyTier(nextStep.tier,nextStep.phase) end
|
||||
end
|
||||
local function result()
|
||||
local d=db();local r=d.profiles[context]
|
||||
windows=windows+1
|
||||
local p10,low=percent(.90),percent(.99)
|
||||
r.last={p10=p10,low1=low,frames=frames,seconds=elapsed,tier=r.tier}
|
||||
-- Require two complete windows at the same tier and about 10% headroom.
|
||||
local passed=p10>=d.target*1.08 and low>=d.target*.80
|
||||
if passed then good=good+1 else good=0 end
|
||||
if good>=2 then
|
||||
r.best=r.tier;good=0
|
||||
pending=(r.tier<d.ceiling and windows<8) and r.tier+1 or 'finish'
|
||||
elseif not passed then
|
||||
if r.best then pending='finish'
|
||||
elseif r.tier>1 then pending=r.tier-1
|
||||
elseif windows>=4 then pending='finish' end
|
||||
local s, d = session, db()
|
||||
local r=P.FrameSampleSummary(s.sample); r.tier=s.tier; r.phase=s.phase
|
||||
s.last=r; s.history[#s.history+1]=r
|
||||
if s.phase == 'validate' then
|
||||
if not passed(r,d.target,true) and s.tier > 1 then
|
||||
s.pending={tier=s.tier-1,phase='validate'}
|
||||
else s.pending='finish' end
|
||||
else
|
||||
s.windows=s.windows+1
|
||||
if passed(r,d.target,false) then s.good=s.good+1 else s.good=0 end
|
||||
if s.good >= 2 then
|
||||
s.best=s.tier
|
||||
if s.tier < d.ceiling and s.windows < 10 then s.pending={tier=s.tier+1}
|
||||
else s.pending={tier=s.best,phase='validate'} end
|
||||
elseif not passed(r,d.target,false) then
|
||||
if s.best then s.pending={tier=s.best,phase='validate'}
|
||||
elseif s.tier > 1 then s.pending={tier=s.tier-1}
|
||||
elseif s.windows >= 2 then s.pending={tier=1,phase='validate'} end
|
||||
end
|
||||
if s.windows >= 10 then s.pending={tier=s.best or 1,phase='validate'} end
|
||||
end
|
||||
if windows>=8 then pending='finish' end
|
||||
reset(0);commit()
|
||||
resetSample(0); commit()
|
||||
end
|
||||
local function startContext(which)
|
||||
local d=db();local r=d.profiles[which]
|
||||
if r.calibrated and r.fingerprint==fingerprint() then return false end
|
||||
if InCombatLockdown() then return false end
|
||||
context=which;windows,good=0,0;r.tier=math.min(r.tier or 2,d.ceiling);r.best=nil
|
||||
profile(which,r.tier);cap(math.ceil(d.target*1.2));reset(60)
|
||||
say('Calibrating '..which..': play normally, keep WoW focused. Quality changes wait for combat to end; /ruen optimize pause before switching apps.',
|
||||
'Калибровка '..which..': играйте в активном окне. Изменения применяются вне боя. Перед переключением окон: /ruen optimize pause.')
|
||||
return true
|
||||
local update
|
||||
local function start(which)
|
||||
local d=db(); local saved=d.profiles[which]
|
||||
session={mode=which,tier=math.min(saved.tier or 1,2,d.ceiling),windows=0,good=0,history={}}
|
||||
applyTier(session.tier)
|
||||
f:SetScript('OnUpdate',update)
|
||||
say(('Optimizing %s for %d FPS: move/fight in this area for about 2–5 minutes. Keep WoW focused; /ruen optimize pause before switching apps. Changes wait for combat to end.'):format(which,d.target),
|
||||
('Настройка %s для %d FPS: играйте здесь 2–5 минут. Не переключайте окно; перед переключением /ruen optimize pause. Изменения применяются вне боя.'):format(which,d.target))
|
||||
end
|
||||
local function update(_,dt)
|
||||
if not run or RuenUIDB.disabled then f:SetScript("OnUpdate",nil);return end
|
||||
local d=db()
|
||||
local which=mode()
|
||||
if not context and (not which or (d.profiles[which].calibrated and d.profiles[which].fingerprint==fingerprint())) then
|
||||
f:SetScript("OnUpdate",nil);return
|
||||
local function activate()
|
||||
if not running or loading then return end
|
||||
if P.IsBenchmarkRunning and P.IsBenchmarkRunning() then deferredEnvironment=true; return end
|
||||
deferredEnvironment=nil
|
||||
if InCombatLockdown() then pendingLoad=activate; return end
|
||||
local d=db(); local which=mode(); local r=d.profiles[which]
|
||||
session=nil
|
||||
if r.calibrated and r.revision==2 and r.fingerprint==fingerprint() then
|
||||
profile(r.tier); cap(d.target); f:SetScript('OnUpdate',nil)
|
||||
else start(which) end
|
||||
end
|
||||
update = function(_, dt)
|
||||
if not running or RuenUIDB.disabled then session=nil; f:SetScript('OnUpdate',nil); return end
|
||||
if loading then return end
|
||||
local s=session
|
||||
if not s then f:SetScript('OnUpdate',nil); return end
|
||||
if s.mode ~= mode() then
|
||||
-- Discard the entire old window; never let a different environment
|
||||
-- validate the old profile, even while changes are deferred by combat.
|
||||
session=nil; f:SetScript('OnUpdate',nil); activate(); return
|
||||
end
|
||||
if which~=context then
|
||||
if InCombatLockdown() then reset(30); return end
|
||||
if context then context=nil;pending=nil;cap(d.target);reset(30) end
|
||||
if which then startContext(which) end
|
||||
return
|
||||
end
|
||||
if not context then return end
|
||||
if pending then commit();return end
|
||||
if dt>2 then reset(15);return end -- loading/suspended frame is not a valid sample
|
||||
if warmup>0 then warmup=warmup-dt;return end
|
||||
if dt<=0 then return end
|
||||
-- 0.1 ms bins avoid rounding a healthy high-FPS sample below its target.
|
||||
local bin=math.min(20000,math.max(1,math.ceil(dt*10000)))
|
||||
histogram[bin]=(histogram[bin] or 0)+1;frames=frames+1;elapsed=elapsed+dt
|
||||
if elapsed>=45 then result() end
|
||||
if s.pending then commit(); return end
|
||||
if s.warmup > 0 then s.warmup=math.max(0,s.warmup-dt); return end
|
||||
P.AddFrameSample(s.sample,dt) -- includes real long stalls, not just percentiles
|
||||
if s.sample.seconds >= 20 then result() end
|
||||
end
|
||||
function P.IsOptimizerCalibrating() return session ~= nil or (running and pendingLoad ~= nil) end
|
||||
function P.OptimizerBenchmarkEnded()
|
||||
if deferredEnvironment then activate() end
|
||||
end
|
||||
function P.StopOptimizer()
|
||||
if not RuenUIDB or not RuenUIDB.optimizer then return end
|
||||
local d=db();run=false;d.enabled=false
|
||||
if context then
|
||||
local r=d.profiles[context];profile(context,r.best or 1)
|
||||
local d=db(); running=false; d.enabled=false; pendingLoad=nil; deferredEnvironment=nil
|
||||
if session then
|
||||
local s=session; local tier=s.best or s.tier
|
||||
d.profiles[s.mode].tier=tier
|
||||
profile(tier)
|
||||
end
|
||||
context,pending=nil,nil
|
||||
session=nil
|
||||
if f then f:SetScript('OnUpdate',nil) end
|
||||
cap(d.target or 60)
|
||||
end
|
||||
function P.OptimizerCommand(arg)
|
||||
arg=(arg or ''):lower():match('^%s*(.-)%s*$')
|
||||
local d=db()
|
||||
if arg=='status' then
|
||||
local h=hardware()
|
||||
say(('Optimizer: %s. Requested: %d FPS; effective: %d FPS. Thermal evidence: %s. World: %s; raid: %s.'):format(run and 'ON' or 'OFF',targetFPS(d.requestedFPS),d.target or targetFPS(d.requestedFPS),
|
||||
h.evidence or 'not measured',d.profiles.world and d.profiles.world.calibrated and 'measured' or 'provisional',
|
||||
d.profiles.raid and d.profiles.raid.calibrated and 'measured' or 'provisional'),
|
||||
('Калибровка: %s. Запрошено: %d FPS; текущая цель: %d FPS. Температуры: %s. Мир: %s; рейд: %s.'):format(run and 'ВКЛ' or 'ВЫКЛ',targetFPS(d.requestedFPS),d.target or targetFPS(d.requestedFPS),
|
||||
h.evidence or 'не измерены',d.profiles.world and d.profiles.world.calibrated and 'проверен' or 'не проверен',
|
||||
d.profiles.raid and d.profiles.raid.calibrated and 'проверен' or 'не проверен'))
|
||||
local which=mode(); local r=d.profiles[which]
|
||||
say(('Optimizer: %s; %s; target %d FPS (requested %d). %s. Thermal evidence: %s.'):format(
|
||||
running and 'ON' or 'OFF',which,d.target or validFPS(d.requestedFPS) or 60,
|
||||
validFPS(d.requestedFPS) or 60,session and ('measuring tier '..session.tier..'/5 ('..session.phase..')')
|
||||
or r.calibrated and ('saved tier '..r.tier..'/5; '..(r.metTarget and 'sample passed' or 'target NOT met')) or 'not measured',
|
||||
hardware().evidence or 'not measured'))
|
||||
if r.last then say(('Last sample: p99 %.1f ms; worst %.1f ms; >50/>100/>250 ms frames: %d/%d/%d.'):format(
|
||||
r.last.p99MS or 0,r.last.worstMS or 0,r.last.over50 or 0,r.last.over100 or 0,r.last.over250 or 0)) end
|
||||
return
|
||||
end
|
||||
if InCombatLockdown() then say('Change optimization outside combat.','Меняйте оптимизацию вне боя.');return end
|
||||
if arg=='off' or arg=='pause' then P.StopOptimizer();say('Calibration paused; current settled quality retained.','Калибровка приостановлена.');return end
|
||||
if InCombatLockdown() then say('Change optimization outside combat.','Меняйте оптимизацию вне боя.'); return end
|
||||
if arg=='off' or arg=='pause' then
|
||||
P.StopOptimizer(); say('Calibration paused; settled/current quality retained.','Калибровка приостановлена; текущие настройки сохранены.'); return
|
||||
end
|
||||
if arg=='restore' then
|
||||
P.StopOptimizer()
|
||||
for k,v in pairs(d.original) do pcall(C_CVar.SetCVar,k,v) end
|
||||
RuenUIDB.optimizer=nil;say('Pre-optimization graphics restored.','Исходные настройки графики восстановлены.');return
|
||||
for key,value in pairs(d.original) do pcall(C_CVar.SetCVar,key,value) end
|
||||
RuenUIDB.optimizer=nil; say('Pre-optimization graphics restored.','Исходные настройки графики восстановлены.'); return
|
||||
end
|
||||
if arg~='' and arg~='start' and arg~='resume' and arg~='world' and arg~='raid' then
|
||||
say('/ruen optimize [world|raid|pause|resume|status|restore]');return
|
||||
local cmd, fpsText=arg:match('^(%S+)%s+(%S+)$')
|
||||
cmd=cmd or arg
|
||||
if validFPS(cmd) and not fpsText then fpsText=cmd; cmd='' end
|
||||
local fps=fpsText and validFPS(fpsText)
|
||||
if (fpsText and not fps) or (cmd~='' and cmd~='start' and cmd~='resume' and not d.profiles[cmd]) then
|
||||
say('/ruen optimize [20–240 FPS] | world|dungeon|raid|battleground [FPS] | pause|resume|status|restore'); return
|
||||
end
|
||||
if (arg=='world' or arg=='raid') and mode()~=arg then
|
||||
say('Run this in the requested environment. A solo test cannot validate raid performance.','Запустите в соответствующей зоне. Соло-тест не проверяет производительность в рейде.');return
|
||||
if P.IsBenchmarkRunning and P.IsBenchmarkRunning() then
|
||||
say('Finish the benchmark or /ruen bench stop before changing graphics.','Завершите замер или /ruen bench stop перед настройкой графики.'); return
|
||||
end
|
||||
if arg~='resume' then
|
||||
if context then P.StopOptimizer() end
|
||||
if arg=='world' or arg=='raid' then d.profiles[arg]={tier=2}
|
||||
else d.profiles={world={tier=2},raid={tier=1}} end
|
||||
if d.profiles[cmd] and mode()~=cmd then
|
||||
say('Run this in the requested environment; a solo sample cannot validate raid performance.',
|
||||
'Запустите в соответствующей зоне; соло-замер не проверяет производительность рейда.'); return
|
||||
end
|
||||
d.profiles.world=d.profiles.world or {tier=2};d.profiles.raid=d.profiles.raid or {tier=1}
|
||||
if session then P.StopOptimizer() end
|
||||
local h=hardware()
|
||||
d.requestedFPS=targetFPS(d.requestedFPS)
|
||||
local nextTarget=h.thermalPressure and math.min(d.requestedFPS,45) or d.requestedFPS
|
||||
local nextCeiling=(h.thermalPressure or h.performancePressure) and 2 or (h.loaded and h.thermalCoverage=="full") and 5 or 3
|
||||
if d.target~=nextTarget or d.ceiling~=nextCeiling then
|
||||
for _,r in pairs(d.profiles) do
|
||||
r.calibrated=false;r.best=nil;r.tier=math.min(r.tier or 1,nextCeiling)
|
||||
end
|
||||
d.requestedFPS=fps or validFPS(d.requestedFPS) or 60
|
||||
local target=h.thermalPressure and math.min(d.requestedFPS,45) or d.requestedFPS
|
||||
local ceiling=(h.thermalPressure or h.performancePressure) and 2 or 5
|
||||
if d.target~=target or d.ceiling~=ceiling then
|
||||
for _,r in pairs(d.profiles) do r.calibrated=false end
|
||||
end
|
||||
d.target=nextTarget;d.ceiling=nextCeiling
|
||||
write('RAIDsettingsEnabled',1);write('RenderScale',1);write('MSAAQuality','0,0');write('msaaAlphaTest',0)
|
||||
write('ffxAntiAliasingMode',1);write('vsync',0);write('useTargetFPS',0)
|
||||
profile('world',d.profiles.world.tier);profile('raid',d.profiles.raid.tier);cap(d.target)
|
||||
run=true;d.enabled=true;context=nil;reset(30)
|
||||
f:SetScript('OnUpdate',update)
|
||||
say('Adaptive calibration enabled. World and raid learn separately. Thermal monitoring must be run from the bundled Optimize tool; /reload imports its report.',
|
||||
'Калибровка включена. Мир и рейд проверяются отдельно. Температуры проверяет утилита Optimize из комплекта; /reload загружает отчёт.')
|
||||
say(('Requested target: %d FPS; effective target: %d FPS.'):format(d.requestedFPS,d.target),
|
||||
('Запрошенная цель: %d FPS; текущая цель: %d FPS.'):format(d.requestedFPS,d.target))
|
||||
d.target=target; d.ceiling=ceiling
|
||||
-- A plain command is a fresh measurement HERE, even if the outdoor profile
|
||||
-- previously passed elsewhere. Other environments retain their own evidence.
|
||||
if cmd~='resume' then d.profiles[mode()].calibrated=false end
|
||||
running=true; d.enabled=true
|
||||
activate()
|
||||
end
|
||||
function P.InitializeOptimizer()
|
||||
if f then return end
|
||||
f=CreateFrame('Frame')
|
||||
f:RegisterEvent('PLAYER_ENTERING_WORLD');f:RegisterEvent('PLAYER_REGEN_ENABLED');f:RegisterEvent('DISPLAY_SIZE_CHANGED');f:RegisterEvent('ZONE_CHANGED_NEW_AREA')
|
||||
for _,event in ipairs({'PLAYER_ENTERING_WORLD','PLAYER_LEAVING_WORLD','PLAYER_REGEN_ENABLED',
|
||||
'DISPLAY_SIZE_CHANGED','ZONE_CHANGED_NEW_AREA'}) do f:RegisterEvent(event) end
|
||||
f:SetScript('OnEvent',function(_,event)
|
||||
if event=='PLAYER_REGEN_ENABLED' then
|
||||
if pendingLoad then local load=pendingLoad;pendingLoad=nil;load() end
|
||||
commit()
|
||||
elseif run then
|
||||
if InCombatLockdown() then reset(60);return end
|
||||
-- Never compare frames from different resolutions or loading screens.
|
||||
context,pending=nil,nil;cap(db().target);reset(60)
|
||||
if event=='PLAYER_LEAVING_WORLD' then
|
||||
loading=true; resetSample(8); return
|
||||
elseif event=='PLAYER_REGEN_ENABLED' then
|
||||
if pendingLoad then local fn=pendingLoad; pendingLoad=nil; fn() end
|
||||
commit(); return
|
||||
elseif event=='PLAYER_ENTERING_WORLD' then loading=false end
|
||||
if running then
|
||||
if event=='DISPLAY_SIZE_CHANGED' then
|
||||
for _,p in pairs(db().profiles) do p.calibrated=false;p.best=nil end
|
||||
say('Resolution changed: calibration will measure this resolution.','Разрешение изменено: калибровка будет повторена.') end
|
||||
for _,r in pairs(db().profiles) do r.calibrated=false end
|
||||
end
|
||||
-- Immediately stop measuring; apply the next environment only once
|
||||
-- safe. A loading screen is never charged as a gameplay hitch.
|
||||
session=nil; f:SetScript('OnUpdate',nil); activate()
|
||||
end
|
||||
if run then f:SetScript('OnUpdate',update) end
|
||||
end)
|
||||
local function initializeSaved()
|
||||
local h=hardware()
|
||||
local importKey=h.checkedAt and (tostring(h.checkedAt)..':'..targetFPS(h.targetFPS))
|
||||
if h.autoStart and RuenUIDB.hardwareImport~=importKey then
|
||||
db().requestedFPS=targetFPS(h.targetFPS)
|
||||
P.OptimizerCommand('start');RuenUIDB.hardwareImport=importKey
|
||||
return
|
||||
local key=h.checkedAt and (tostring(h.checkedAt)..':'..(validFPS(h.targetFPS) or 60))
|
||||
if h.autoStart and RuenUIDB.hardwareImport~=key then
|
||||
db().requestedFPS=validFPS(h.targetFPS) or 60
|
||||
P.OptimizerCommand('start'); RuenUIDB.hardwareImport=key; return
|
||||
end
|
||||
local d=RuenUIDB.optimizer
|
||||
if d then
|
||||
cap(d.target or 60) -- recover a benchmark cap after logout/crash
|
||||
if d.enabled then P.OptimizerCommand('resume') end
|
||||
end
|
||||
if d and d.enabled then P.OptimizerCommand('resume')
|
||||
elseif d then cap(d.target or 60) end -- recover interrupted trial cap
|
||||
end
|
||||
if InCombatLockdown() then pendingLoad=initializeSaved else initializeSaved() end
|
||||
end
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
local _, P = ...
|
||||
P.version = 5
|
||||
P.release = "2026.11.21.8-beta.1"
|
||||
P.release = "2026.11.22.1-beta.1"
|
||||
P.graphicsVersion = 2
|
||||
P.layoutName = "Ruen UI - Clear ESDF"
|
||||
function P.IsOurLayout(layout)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
## Interface: 16001
|
||||
## Title: Ruen UI
|
||||
## Notes: ESDF, mouse and menu controls, inventory layout and Spoken language controls. /ruen help
|
||||
## Version: 2026.11.21.8-beta.1
|
||||
## Version: 2026.11.22.1-beta.1
|
||||
## Author: Ruen UI contributors
|
||||
## SavedVariables: RuenUIDB
|
||||
## SavedVariablesPerCharacter: RuenUICharacter
|
||||
@ -24,6 +24,7 @@ OverlayLayout.lua
|
||||
DamageMeters.lua
|
||||
ClassAssist.lua
|
||||
HardwareProfile.lua
|
||||
FrameTiming.lua
|
||||
Optimizer.lua
|
||||
Benchmark.lua
|
||||
AddonPresets.lua
|
||||
|
||||
@ -68,3 +68,6 @@ python3 scripts/build_release.py /path/to/output
|
||||
The allowlist excludes tests, third-party payloads, caches, account saves and Git metadata. The ZIP includes the launcher source and installer helpers. `SHA256SUMS.txt` verifies the ZIP; `manifest.json` verifies its extracted files. Neither is a digital signature. Publish the named ZIP and checksum as Gitea prerelease assets. A Gitea source archive is for development and lacks the generated installer manifest.
|
||||
|
||||
The Windows launcher can be rebuilt with Clang targeting x86_64-pc-windows-msvc and LLD in link mode. Compile `Tools/Ruen-Setup.c` with `-Os -ffreestanding -fno-stack-protector -fshort-wchar`; create a KERNEL32 import library from `Tools/kernel32.def`; link with `/entry:entry /subsystem:console /machine:x64 /nodefaultlib /opt:ref /timestamp:0`. It uses only KERNEL32 imports, no bundled runtime. The included binary is unsigned.
|
||||
|
||||
|
||||
The frame recorder is in `FrameTiming.lua` and must precede both `Optimizer.lua` and `Benchmark.lua` in fixtures and the TOC. `check-benchmark.lua` includes smooth reported FPS with sparse 200 ms stalls, partial/pause/loading behavior, multi-second stalls, bounded persistence and no idle updates. `check-timers-optimizer.lua` exercises scene retuning, four independent environment profiles, targets, capped final validation, sparse-hitch rejection, loading/combat deferral, unsupported controls and exact restore. These simulations establish detection/selection behavior, not real GPU responsiveness or improvement in the user's cave.
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
# Установка Ruen UI — бета
|
||||
|
||||
1. Установите **WoW: Forever** через Battle.net и дождитесь окончания загрузки.
|
||||
2. Откройте [Releases](https://scm.bstein.dev/bstein/ruen-ui/releases) и скачайте **Ruen-UI-2026.11.21.8-beta.1.zip**. Для скачивания регистрация не нужна.
|
||||
2. Откройте [Releases](https://scm.bstein.dev/bstein/ruen-ui/releases) и скачайте **Ruen-UI-2026.11.22.1-beta.1.zip**. Для скачивания регистрация не нужна.
|
||||
3. Полностью распакуйте ZIP. Закройте WoW.
|
||||
4. Для русского варианта запустите **Install-Russian.cmd**. Обычная установка: **Ruen-Setup.exe**. Установщик сам ищет игру; если нужно, укажите папку `_forever_`, в которой находится `Wow.exe`.
|
||||
5. В Battle.net выберите WoW: Forever → шестерёнка → изменение установки. Установите английские и русские файлы игры. Выберите русский язык текста и речи в настройках **игры**, а не приложения Battle.net. Дождитесь 100% загрузки.
|
||||
@ -35,3 +35,14 @@
|
||||
Панель питомца — это **10 стандартных ячеек и 2 расширения** с использованием свободных ячеек второй страницы панели действий. Игра не получает дополнительные стандартные ячейки питомца. Если свободных ячеек нет, Ruen сообщает об этом и не затирает существующие способности.
|
||||
|
||||
После обновления проверьте `/ruen status`, цифровые клавиши, смену защитной/пассивной стойки, вызов питомца и сумки при выбранной цели. Для сравнения FPS запустите `/ruen bench` и три минуты играйте, не переключаясь в другое окно: фоновое ограничение FPS иначе исказит результат. Следующая строка показывает время CPU Ruen, если встроенный профилировщик доступен. При рывках сообщите обе строки; измерение не меняет настройки графики. Подробные ограничения беты: [RELEASE-REVIEW.md](RELEASE-REVIEW.md).
|
||||
|
||||
|
||||
## Рывки и настройка графики в текущей зоне
|
||||
|
||||
Вне боя введите `/ruen optimize 60` (или `30` для цели 30 FPS), затем 2–5 минут двигайтесь и сражайтесь в этой зоне. Без числа команда использует 60 FPS либо сохранённую цель. Повторный запуск заново проверяет текущую зону. Мир, подземелье, рейд и поле боя измеряются отдельно. Изменения применяются вне боя; после завершения постоянного опроса кадров нет.
|
||||
|
||||
Проверяются время кадров и отдельные задержки, включая редкие кадры дольше 100 мс. Если минимальные настройки не обеспечили цель, Ruen прямо сообщает об этом. Разрешение, масштаб отрисовки, текстуры, интерфейс и драйверы сохраняются; настраиваются в том числе освещение и тени. Пока оптимизатор включён, он сам переключает профили и отключает встроенную замену графики для рейдов. Датчики температуры по-прежнему проверяет внешняя утилита.
|
||||
|
||||
`/ruen optimize status` — состояние; `pause` — остановить измерение; `resume` — продолжить работу профилей; `restore` — вернуть исходную графику. Перед переключением в другое приложение используйте `pause`: активность окна автоматически не определяется.
|
||||
|
||||
После настройки `/ruen bench` записывает каждый игровой кадр за три минуты: средний FPS, 1% low, p99, максимальную задержку и количество кадров дольше 50/100/250 мс. Загрузочные экраны исключаются, реальные многосекундные рывки учитываются. `/ruen bench pause|resume|stop|status` управляет замером; `stop` сохраняет неполный результат. Одновременная настройка графики и замер запрещены. Последние пять отчётов сохраняются при выходе или `/reload`. Старые секундные выборки FPS нельзя напрямую сравнивать с новыми процентилями кадров.
|
||||
|
||||
@ -58,7 +58,34 @@ Before relying on new bindings in combat, check `/ruen status`, press the number
|
||||
|
||||
## Optional optimization
|
||||
|
||||
Run while playing a representative area, with the laptop powered and cooled as you normally use it:
|
||||
For stuttering in the current area, run this **outside combat**, then move and fight in the same area with WoW focused:
|
||||
|
||||
```text
|
||||
/ruen optimize 60
|
||||
```
|
||||
|
||||
Use `/ruen optimize 30` for a 30 FPS target (accepted range 20–240). `/ruen optimize` alone uses 60 initially, then remembers your requested target. It **remeasures the current environment even if an earlier sample elsewhere passed**. World, dungeon, raid and battleground profiles are separate; a cave outside an instance is a world sample. Saved profiles apply on environment changes, outside combat. While enabled, Ruen owns the base graphics settings and disables the native raid override so an unseen preset cannot replace the measured settings.
|
||||
|
||||
Calibration usually takes 2–5 minutes of gameplay (up to roughly seven if several final checks fail), plus time waiting for combat to end. It searches five ordered quality presets, requiring two passing 20-second windows before raising quality, then verifies the selected preset at your final FPS cap. Trial caps are at most 10% above the effective target. Smoothness checks include the 90th/99th percentile frame time and explicit counts above 50/100 ms; infrequent hitches cannot disappear behind a good average. At the lowest tier it reports an unmet target honestly if stalls persist. This finds the highest passing tested preset in the sampled scene, not a mathematically optimal configuration or a guarantee for every later fight.
|
||||
|
||||
The presets include shadows, ambient shading, secondary lighting, water, compute effects, visibility and scenery detail. Essential spell effects/projected textures remain enabled; render scale, texture resolution, UI geometry and GPU/API/driver selection are retained. The optimizer uses no per-frame loop after settling. It does not change fans, voltages or drivers. Shader compilation, asset streaming, other software, network stalls and overheating may require investigation outside graphics settings.
|
||||
|
||||
- `/ruen optimize status`: current environment, target, phase/saved tier and last frame evidence.
|
||||
- `/ruen optimize pause`: stop measuring and retain the current/best tested settings; use this **before switching apps**.
|
||||
- `/ruen optimize resume`: enable environment profiles and finish an unmeasured profile.
|
||||
- `/ruen optimize restore`: stop calibration and restore the graphics values saved before optimization.
|
||||
|
||||
For a three-minute **read-only** measurement after optimization finishes:
|
||||
|
||||
```text
|
||||
/ruen bench
|
||||
```
|
||||
|
||||
This records every gameplay frame interval and reports actual frames/elapsed-time average FPS, the reciprocal of the mean slowest 1% frame time, p99 frame time, worst frame, and counts above 50/100/250 ms. Histogram percentiles use 0.25 ms bins, capped at 10 seconds; larger stalls are flagged and their worst duration is retained. Known loading screens are excluded, but ordinary multi-second gameplay stalls are counted. Window focus cannot be verified: use `/ruen bench pause` before switching apps and `/ruen bench resume` when back. `/ruen bench stop` saves a clearly marked partial run; `status` reports progress. Benchmarking and active calibration cannot run together.
|
||||
|
||||
The following line reports Ruen CPU time from the built-in profiler when available. Its recent timings are rolling averages; correlation does not prove the cause of a hitch. CPU threshold deltas cover wall time, including pauses/loading. The saved report includes up to 180 diagnostic snapshots and graphics settings at both endpoints; the latest five reports are retained on logout/reload. Compare the same route, activity, settings and window size. The old one-second FPS benchmarks are not directly comparable to the new frame percentiles.
|
||||
|
||||
Optional **hardware/thermal evidence** still comes from the external companion, run while playing normally with the laptop powered/cooled as usual:
|
||||
|
||||
```powershell
|
||||
.\Ruen-Setup.exe --optimize 30 -Seconds 600
|
||||
@ -68,7 +95,7 @@ Run while playing a representative area, with the laptop powered and cooled as y
|
||||
python3 Ruen-Setup --wow '/path/to/_forever_' --optimize 30 --seconds 600
|
||||
```
|
||||
|
||||
The FPS target defaults to 60 (accepted range 20–240). Type `/reload` afterward to import the local hardware report. `/ruen bench` collects 180 one-second FPS readings: keep WoW focused for the full three minutes, since the background FPS cap can otherwise contaminate the result. Compare the same route, graphics settings and window size. This is not a per-frame 1% low. The next line reports Ruen CPU time from the built-in profiler when available; share both lines when investigating stutter. The saved report includes slow-tick deltas and start/end graphics settings. These diagnostics run only during the manual benchmark and do not alter settings. World and raid settings learn separately; a quiet outdoor sample cannot establish raid performance. Missing temperature/throttling counters are reported as unavailable, not proof of safe temperatures. `/ruen optimize status`, `pause`, `resume`, and `restore` control in-game calibration. No stress test or driver installation is performed.
|
||||
Type `/reload` afterward to import its report. Recent thermal/performance pressure limits the quality search; thermal pressure can lower a requested target above 45 to 45 FPS. Missing sensors are reported as unavailable, never proof of safe temperatures. No stress test or driver installation is performed.
|
||||
|
||||
## Undo
|
||||
|
||||
|
||||
@ -1,6 +1,14 @@
|
||||
# Release review — 2026.11.21.8-beta.1
|
||||
# Release review — 2026.11.22.1-beta.1
|
||||
|
||||
Reviewed 21 November 2026. **Suitable for an opt-in public beta, not a general-availability certification.** This follow-up preserves the native selection atlas on the actual checked texture and retains bounded CPU diagnostics in the manual FPS benchmark. The coordinated character/layout update is retained. Earlier gameplay confirmations apply to the earlier builds, not automatically to these changes. The current checks below were rerun against this candidate.
|
||||
Reviewed 22 November 2026. **Opt-in public beta; not a general-availability certification.** This follow-up records every gameplay frame during manual benchmarking and retunes graphics on demand in the current scene. It retains the user-confirmed beta8 pet highlight fix and coordinated layout/profile work. Automated evidence does not establish that this update fixes the user's live cave stutter; that comparison is pending.
|
||||
|
||||
## Frame timing and scene optimization
|
||||
|
||||
- Manual benchmarking records bounded 0.25 ms frame histograms, true frames/elapsed-time average, mean slowest-1% FPS, p99, worst duration, and explicit >50/100/250 ms frame counts. Sparse hitches remain visible even when smoothed FPS and p99 look healthy. Only known loading is excluded; >2-second gameplay stalls no longer disappear.
|
||||
- The optimizer accepts an in-game FPS target and retests the current environment. Dungeon and battleground profiles are now separate from world/raid profiles. It explicitly owns the active base settings, disabling native raid overrides, and includes cave-relevant secondary lighting plus PBR water controls omitted by the old tuner.
|
||||
- Five quality presets, two passing 20-second windows before upgrades, up to ten search windows plus bounded capped validation. Final checks include explicit hitch counts. Persistent stalls at the minimum tier are reported as unmet; the search cannot guarantee an optimal setting combination or solve all external causes.
|
||||
- Changes wait until outside combat. Loading/environment changes discard cross-scene evidence. Benchmarking and active tuning are mutually exclusive. Settled profiles remove their OnUpdate handler. Restore retains original values; render scale, UI scale, texture resolution and GPU/API/drivers are not modified.
|
||||
- Focus is not automatically known: explicit pause/resume commands and instructions prevent knowingly counting app switching as gameplay. Native profiler snapshots stay bounded and run only during the manual benchmark.
|
||||
|
||||
## Coordinated update
|
||||
|
||||
@ -46,7 +54,7 @@ The common 96-button action layout is retained. It provides capacity, not automa
|
||||
| --- | --- |
|
||||
| Installer transactions | 14 automated tests: Linux fresh/repeat install, saved-setting/profile preservation, account-binding restore, legacy migration, partial-write rollback, locking, missing backups, incompatible companions, download failure, symlink rejection, package corruption and archive-path validation. PowerShell fixtures include fresh/repeat install, preservation, restore, corruption, download failure, missing backup and unsafe paths. |
|
||||
| Windows scripts | PowerShell 7.7 on Linux executed filesystem fixtures. Syntax parsed successfully. The unchanged unsigned x64 executable and its included C source retain the preceding release review; this update does not change the launcher binary. **Native Windows PowerShell 5.1, SmartScreen and GUI execution remain untested.** |
|
||||
| Dependencies | The previous distribution review downloaded, hashed and extracted all four base archives against the unchanged lock, and installed them through PowerShell in a disposable game path containing spaces and Cyrillic characters. All seven pinned download endpoints were rechecked for this candidate: HTTPS 200 and matching byte counts. This HEAD check does not replace archive hashing; current installations verify the full pinned downloads. Large audio hashes retain prior verification records; the full audio payload was not downloaded again during this review. Every fresh installation independently checks its full downloads. |
|
||||
| Dependencies | The previous distribution review downloaded, hashed and extracted all four base archives against the unchanged lock, and installed them through PowerShell in a disposable game path containing spaces and Cyrillic characters. The preceding beta8 review checked all seven unchanged pinned download endpoints: HTTPS 200 and matching byte counts. This HEAD check does not replace archive hashing; current installations verify the full pinned downloads. Large audio hashes retain prior verification records; the full audio payload was not downloaded again during this review. Every fresh installation independently checks its full downloads. |
|
||||
| Character profiles | Nine classes × 24 effective number/Ctrl-number mappings; underlying account bindings unchanged, personal edits preserved, actual restricted snippet executed in a modeled engine, combat handoff/deferred changes, role events, capability reservations, restore, and full new-alt login with customized shared keys. **Live secure VM/priority behavior remains unverified.** |
|
||||
| Layout policy | Shared control reservations and chat font preservation/conditional restore; chat input/tabs and native panels counted without relocating their secure managers. |
|
||||
| Layout matrix | 9 classes × 8 environments × 8 display/scale cases, repeated with native aura/cast/combo/BG-widget footprints: **1,152 scenarios, zero modeled unintended intersections, offscreen controls, undersized group frames or wrong meter visibility**. Prior restricted-aura stress fixtures are reset before the base matrix. This is geometry/API simulation, not screenshots of every live class. |
|
||||
@ -54,8 +62,8 @@ The common 96-button action layout is retained. It provides capacity, not automa
|
||||
| Pet controls | Native ten-button row plus two extras: actual native page map and secure-dispatch code used in a simulated client; tests cover spellbook discovery, command identity, localization, rank/pet changes, occupied slots and rejection. Native selected artwork, opacity/layer/blend parity, mutual stance state and 500 visual-only transitions passed. 1,200 opaque-cooldown refreshes passed; rejected placement remains one attempt through 500 events/reload. This does not establish every action in the live secure VM. |
|
||||
| Damage meter | Native timer/visibility code with tracked-taint simulation passed 1,000 combat starts; no direct writes to native visibility state or calls to its refresh methods. PvE auto, PvP exclusion, manual modes, no-room recovery and combat deferral passed. The previous live error was also reported resolved after reload. |
|
||||
| Audio | 94 checks against the pinned Gun Silencer Forever code and Ruen bridge passed, including default volume, existing choices, off/restore, failed playback and missing dependency. |
|
||||
| Timers/optimization | Swing lanes, idle sleep, secret values, world/raid separation, frame sampling, thermal input, pause and undo tests passed. No native Windows hardware/thermal validation is claimed. |
|
||||
| Benchmark diagnostics | Native profiler API availability/opaque values, per-run slow-tick deltas, 180-reading bound, low-FPS attribution, graphics-change warnings and zero automatic/idle work tested. Recent timing is a rolling 60-tick mean, not an exact per-frame maximum. |
|
||||
| Timers/optimization | Swing lanes, idle sleep, secret values, four environment profiles, requested FPS parsing, sparse-hitch rejection, capped validation, long-stall counting, loading/combat deferral, unsupported controls, thermal input, pause and exact undo passed. No native Windows hardware/thermal validation is claimed. |
|
||||
| Benchmark diagnostics | Simulated 60 FPS readings with repeated 200 ms frame stalls expose the old blind spot. Per-frame capture, tail calculation, long stalls, loading/pause exclusion, five-report bounds and mutual exclusion passed alongside native profiler API availability/opaque values, per-run slow-tick deltas, 180-snapshot bound and graphics-change warnings. Recent timing is a rolling 60-tick mean, not an exact per-frame maximum. |
|
||||
| Privacy/package | First-party allowlist, blank hardware defaults, dependency-license review and scan for local paths/account data. Only legacy migration identifiers retain the former addon name. Release ZIP has a per-file SHA-256 manifest and a separate ZIP checksum. |
|
||||
|
||||
Environments: solo, outdoor party, dungeon, 10/20/40-player raid and 10/40-player battleground. Displays: 1280×720, 1366×768, 1920×1080 at two scales, 2560×1440 at two scales and 3840×2160 at two scales.
|
||||
|
||||
@ -7,7 +7,7 @@ from pathlib import Path
|
||||
import zipfile
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
VERSION = '2026.11.21.8-beta.1'
|
||||
VERSION = '2026.11.22.1-beta.1'
|
||||
FILES = ['Ruen-Setup', 'Ruen-Setup.exe', 'Install-Ruen-UI.ps1', 'Install-Ruen-UI.cmd',
|
||||
'Install-Ruen-UI-Russian.cmd', 'Install-Windows.cmd', 'Install-Russian.cmd',
|
||||
'Optimize-Ruen-UI.ps1', 'dependencies.lock.json', 'README.md', 'LICENSE',
|
||||
|
||||
@ -1,11 +1,17 @@
|
||||
local root=assert(arg[1])
|
||||
local P={release='test'}
|
||||
local P={release='test',Localized=function(a)return a end}
|
||||
local cvars={maxFPS='60',maxFPSBk='15'}
|
||||
RuenUIDB={optimizer={enabled=true,profiles={world={tier=2,calibrated=true}}}}
|
||||
C_CVar={GetCVar=function(k)return cvars[k]end,SetCVar=function()error('benchmark must not change graphics')end}
|
||||
function GetPhysicalScreenSize()return 1920,1080 end
|
||||
-- No frame creation, timer, expensive script profiler or idle work is allowed.
|
||||
function CreateFrame()error('benchmark must reuse the existing manual ticker')end
|
||||
local made={}
|
||||
function CreateFrame()
|
||||
local f={scripts={},events={}}
|
||||
function f:SetScript(k,v)self.scripts[k]=v end
|
||||
function f:RegisterEvent(e)self.events[e]=true end
|
||||
made[#made+1]=f;return f
|
||||
end
|
||||
local opaque={};function issecretvalue(v)return v==opaque end
|
||||
Enum={};APIDocumentation={AddDocumentationTable=function(_,d)
|
||||
for _,t in ipairs(d.Tables or {})do if t.Type=='Enumeration'then
|
||||
@ -20,6 +26,7 @@ C_AddOnProfiler={IsEnabled=function()return true end,
|
||||
GetAddOnMetric=function(name,k)assert(name=='RuenUI');calls=calls+1;return readings[k]end,
|
||||
GetOverallMetric=function(k)assert(k==E.RecentAverageTime);return .4 end,
|
||||
GetTopKAddOnsForMetric=function(k,n)assert(k==E.RecentAverageTime and n==3);topCalls=topCalls+1;return {{addOnName='Other',metricValue=.3}}end}
|
||||
assert(loadfile(root..'FrameTiming.lua'))('RuenUI',P)
|
||||
assert(loadfile(root..'Benchmark.lua'))('RuenUI',P)
|
||||
assert(calls==0,'loading diagnostics started profiler work')
|
||||
local d=P.StartBenchmarkDiagnostics()
|
||||
@ -54,3 +61,40 @@ end
|
||||
local reset=P.StartBenchmarkDiagnostics();readings[E.CountTimeOver5Ms]=1
|
||||
P.FinishBenchmarkDiagnostics(reset);assert(reset.ticksOver.CountTimeOver5Ms==nil)
|
||||
print('PASS: bounded native profiler snapshots, per-benchmark slow-tick deltas, low-FPS attribution, graphics-change detection, unavailable/opaque data and no idle or graphics writes')
|
||||
|
||||
-- Fast smoothed FPS with sparse visible freezes: the old once/second FPS
|
||||
-- sampling would pass, while frame recording must show their true duration.
|
||||
function time()return 123456 end
|
||||
function GetFramerate()return 60 end
|
||||
P.BenchmarkCommand('');local f=made[#made]
|
||||
assert(P.IsBenchmarkRunning())
|
||||
local function frames(n,dt)for _=1,n do if f.scripts.OnUpdate then f.scripts.OnUpdate(f,dt)end end end
|
||||
frames(60,1/60) -- initial settling
|
||||
for i=1,11000 do frames(1,i%600==0 and .2 or 1/60)end
|
||||
assert(not P.IsBenchmarkRunning() and not f.scripts.OnUpdate)
|
||||
local report=RuenUIDB.reports[#RuenUIDB.reports]
|
||||
assert(report.over100>=17 and report.worstMS==200 and report.p99MS<18,'sub-second hitches disappeared')
|
||||
assert(report.low1FPS<report.meanFPS and report.meanFPS<60 and not report.partial)
|
||||
assert(#report.diagnostics.samples<=180 and not report.diagnostics.settingsChanged)
|
||||
assert(not report.focusVerified and report.diagnostics.samples[1].fps==60)
|
||||
-- Loading and explicit pause exclude time, but unknown 3s stalls count.
|
||||
P.BenchmarkCommand('');frames(120,1/60)
|
||||
P.BenchmarkCommand('pause');frames(30,1);P.BenchmarkCommand('resume');frames(120,1/60)
|
||||
f.scripts.OnEvent(f,'PLAYER_LEAVING_WORLD');frames(10,5)
|
||||
f.scripts.OnEvent(f,'PLAYER_ENTERING_WORLD');frames(180,1/60)
|
||||
frames(1,3);P.BenchmarkCommand('stop')
|
||||
report=RuenUIDB.reports[#RuenUIDB.reports]
|
||||
assert(report.partial and report.worstMS==3000 and report.over250==1 and report.excludedLoadingSeconds>=50)
|
||||
assert(report.seconds<8 and not f.scripts.OnUpdate)
|
||||
P.IsOptimizerCalibrating=function()return true end
|
||||
P.BenchmarkCommand('');assert(not P.IsBenchmarkRunning())
|
||||
P.IsOptimizerCalibrating=nil
|
||||
for i=1,7 do P.BenchmarkCommand('');frames(120,1/60);P.BenchmarkCommand('stop')end
|
||||
assert(#RuenUIDB.reports==5,'reports unbounded')
|
||||
-- Histogram tail definition and invalid frame guard.
|
||||
local sample=P.NewFrameSample()
|
||||
for i=1,99 do P.AddFrameSample(sample,.01)end
|
||||
P.AddFrameSample(sample,.2);P.AddFrameSample(sample,0);P.AddFrameSample(sample,math.huge)
|
||||
local summary=P.FrameSampleSummary(sample)
|
||||
assert(summary.frames==100 and summary.p99MS==10 and summary.low1FPS==5 and summary.over100==1)
|
||||
print('PASS: every-frame stutter capture despite smooth FPS, actual slowest-1% average, loading/pause exclusion, long stalls, bounded reports, benchmark/optimizer mutual exclusion and no idle frames')
|
||||
|
||||
@ -252,7 +252,7 @@ assert(loadfile(root..'CharacterProfiles.lua'))('RuenUI',P)
|
||||
assert(loadfile(root..'LayoutPolicy.lua'))('RuenUI',P)
|
||||
assert(loadfile(root..'Brand.lua'))('RuenUI',P)
|
||||
assert(loadfile(root..'ClassLayout.lua'))('RuenUI',P)
|
||||
for _,file in ipairs({'ButtonStyle.lua','PetExtras.lua','SwingTimers.lua','ExtraBars.lua','OverlayLayout.lua','DamageMeters.lua','ClassAssist.lua','HardwareProfile.lua','Optimizer.lua','GunAudio.lua','Benchmark.lua'}) do assert(loadfile(root..file))('RuenUI',P) end
|
||||
for _,file in ipairs({'ButtonStyle.lua','PetExtras.lua','SwingTimers.lua','ExtraBars.lua','OverlayLayout.lua','DamageMeters.lua','ClassAssist.lua','HardwareProfile.lua','FrameTiming.lua','Optimizer.lua','GunAudio.lua','Benchmark.lua'}) do assert(loadfile(root..file))('RuenUI',P) end
|
||||
local available={'JUMP','TARGETNEARESTENEMY','TARGETPREVIOUSENEMY'}
|
||||
for _,entry in ipairs(P.menuBindings) do available[#available+1]=entry[2] end
|
||||
function GetNumBindings() return #available end
|
||||
@ -1611,24 +1611,26 @@ do
|
||||
print('PASS: shared obstacle reservations cover chat input/tabs and native profession/spellbook/map/character/auction panels without moving them')
|
||||
end
|
||||
|
||||
-- Exercise the real slash-command/ticker integration with no native profiler.
|
||||
-- Exercise real slash dispatch with the frame recorder, no native profiler.
|
||||
do
|
||||
local tick,count,cancelled
|
||||
C_Timer.NewTicker=function(seconds,fn)
|
||||
assert(seconds==1);count=(count or 0)+1;tick=fn;cancelled=false
|
||||
return {Cancel=function()cancelled=true end}
|
||||
local oldCreate=CreateFrame; local captureFrame,created
|
||||
CreateFrame=function(...)
|
||||
local f=oldCreate(...);captureFrame=f;created=(created or 0)+1;return f
|
||||
end
|
||||
function GetFramerate()return 55 end
|
||||
local before=CopyTable(cvars)
|
||||
for run=1,7 do
|
||||
SlashCmdList.RUENUI('bench');SlashCmdList.RUENUI('bench')
|
||||
assert(count==run,'duplicate benchmark ticker')
|
||||
for i=1,180 do tick()end
|
||||
assert(cancelled and #RuenUIDB.reports<=5,'ticker/report retention leak')
|
||||
assert(created==1 and P.IsBenchmarkRunning(),'duplicate benchmark frame')
|
||||
for i=1,55*183 do
|
||||
if captureFrame.scripts.OnUpdate then captureFrame.scripts.OnUpdate(captureFrame,1/55)end
|
||||
end
|
||||
assert(not captureFrame.scripts.OnUpdate and not P.IsBenchmarkRunning() and #RuenUIDB.reports<=5,'frame/report retention leak')
|
||||
local report=RuenUIDB.reports[#RuenUIDB.reports]
|
||||
assert(report.mean==55 and report.count==180 and #report.diagnostics.samples==180)
|
||||
assert(report.diagnostics.release==P.release)
|
||||
assert(math.abs(report.meanFPS-55)<.001 and report.seconds>=180 and #report.diagnostics.samples<=180)
|
||||
assert(report.diagnostics.release==P.release and report.over100==0)
|
||||
end
|
||||
CreateFrame=oldCreate
|
||||
assert(eq(cvars,before),'benchmark changed graphics')
|
||||
print('PASS: real bench command, one ticker, 180 readings, CPU diagnostics attached, five-report limit and no graphics changes')
|
||||
print('PASS: real bench slash dispatch, single reused frame, per-frame report, native diagnostics, five-report bound and no graphics changes')
|
||||
end
|
||||
|
||||
@ -32,32 +32,91 @@ event(dock,'PLAYER_SWING',2,1);speeds={2};event(dock,'UNIT_INVENTORY_CHANGED','p
|
||||
combat=true;P.SwingCommand('preview');assert(not dock.shown);combat=false
|
||||
P.SwingCommand('preview');assert(dock.shown);P.SwingCommand('off');assert(not dock.shown and not dock.scripts.OnUpdate)
|
||||
print('PASS: three native swing lanes, progress, fade, no idle ticks, equipment, combat end, secret values, preview and off')
|
||||
local cvars={};local writes=0
|
||||
local cvars={RenderScale='0.9',graphicsTextureResolution='2'};local writes=0
|
||||
C_CVar={GetCVar=function(k)return cvars[k] or '2'end,SetCVar=function(k,v)assert(not combat,'graphics modified in combat');writes=writes+1;cvars[k]=tostring(v)end}
|
||||
function IsGraphicsSettingValueSupported()return 0 end
|
||||
function IsInInstance()return where~='none',where end
|
||||
function GetPhysicalScreenSize()return width,1080 end
|
||||
function GetRealZoneText()return 'Test zone' end
|
||||
function GetSubZoneText()return 'Test cave' end
|
||||
assert(loadfile(root..'FrameTiming.lua'))('test',P)
|
||||
assert(loadfile(root..'Optimizer.lua'))('test',P);P.InitializeOptimizer();local f=made[#made]
|
||||
P.OptimizerCommand('start');assert(cvars.RAIDsettingsEnabled=='1' and cvars.RenderScale=='1')
|
||||
local function frames(n,dt)for _=1,n do clock=clock+dt; if f.scripts.OnUpdate then f.scripts.OnUpdate(f,dt)end end end
|
||||
-- Two passing windows per tier, bounded at eight windows.
|
||||
frames(72*600,1/72)
|
||||
P.OptimizerCommand('start')
|
||||
assert(cvars.RAIDsettingsEnabled=='0' and cvars.RenderScale=='0.9','native overrides active or resolution changed')
|
||||
assert(cvars.graphicsLightMode=='0' and cvars.graphicsPBRLiquidDetail=='0','expensive lighting omitted')
|
||||
frames(66*600,1/66)
|
||||
local d=RuenUIDB.optimizer
|
||||
assert(d.profiles.world.calibrated and d.profiles.world.metTarget,'world should pass')
|
||||
assert(not d.profiles.raid.calibrated,'solo must not validate raid')
|
||||
assert(cvars.maxFPS=='60','trial cap leaked')
|
||||
assert(not f.scripts.OnUpdate,'settled optimizer must not poll every frame')
|
||||
where='raid';f.scripts.OnEvent(f,'ZONE_CHANGED_NEW_AREA');frames(72*61,1/72)
|
||||
combat=true;local before=writes;frames(72*120,1/72);assert(writes==before,'combat edits occurred')
|
||||
combat=false;f.scripts.OnEvent(f,'PLAYER_REGEN_ENABLED');frames(72*500,1/72)
|
||||
assert(d.profiles.raid.calibrated,'raid did not calibrate')
|
||||
assert(not f.scripts.OnUpdate,'settled raid optimizer must sleep')
|
||||
P.OptimizerCommand('restore');assert(not RuenUIDB.optimizer and cvars.RAIDsettingsEnabled=='2')
|
||||
-- Sustained low performance chooses the low tier and reports unmet target.
|
||||
where='none';P.hardwareProfile={};P.OptimizerCommand('start');frames(25*600,1/25)
|
||||
d=RuenUIDB.optimizer;assert(d.profiles.world.calibrated and not d.profiles.world.metTarget and d.profiles.world.tier==1)
|
||||
assert(d.profiles.world.tier==5 and d.profiles.world.revision==2,'did not search/validate highest allowed tier')
|
||||
assert(d.profiles.world.last.phase=='validate' and d.profiles.world.subzone=='Test cave')
|
||||
assert(not d.profiles.raid.calibrated and not d.profiles.dungeon.calibrated,'solo validated instance')
|
||||
assert(cvars.maxFPS=='60' and not f.scripts.OnUpdate,'trial cap or idle polling leaked')
|
||||
local before=writes;frames(600,1/60);assert(writes==before)
|
||||
-- A plain command must remeasure this cave despite previous world success.
|
||||
P.OptimizerCommand('');assert(P.IsOptimizerCalibrating() and not d.profiles.world.calibrated)
|
||||
P.OptimizerCommand('pause');assert(not f.scripts.OnUpdate and not d.enabled)
|
||||
P.hardwareProfile={checkedAt=clock,loaded=true,thermalPressure=true};P.OptimizerCommand('start')
|
||||
assert(d.target==45 and d.ceiling==2,'thermal evidence ignored')
|
||||
-- Entering a dungeon must measure/apply dungeon settings, not ignore it.
|
||||
where='party';P.OptimizerCommand('30');assert(d.requestedFPS==30 and d.target==30)
|
||||
frames(33*600,1/33)
|
||||
assert(d.profiles.dungeon.calibrated and d.profiles.dungeon.metTarget and cvars.maxFPS=='30')
|
||||
assert(d.profiles.dungeon.tier==5 and cvars.graphicsShadowQuality=='3')
|
||||
-- Combat defers ALL writes, including environment handoff and restore.
|
||||
where='raid';combat=true;before=writes;f.scripts.OnEvent(f,'ZONE_CHANGED_NEW_AREA')
|
||||
frames(33*120,1/33);assert(writes==before,'combat edits occurred')
|
||||
P.OptimizerCommand('restore');assert(RuenUIDB.optimizer==d)
|
||||
combat=false;f.scripts.OnEvent(f,'PLAYER_REGEN_ENABLED');frames(33*600,1/33)
|
||||
assert(d.profiles.raid.calibrated and not d.profiles.battleground.calibrated)
|
||||
where='pvp';f.scripts.OnEvent(f,'ZONE_CHANGED_NEW_AREA');frames(33*600,1/33)
|
||||
assert(d.profiles.battleground.calibrated and not f.scripts.OnUpdate)
|
||||
P.OptimizerCommand('restore');assert(not RuenUIDB.optimizer and cvars.RAIDsettingsEnabled=='2')
|
||||
assert(cvars.RenderScale=='0.9' and cvars.graphicsTextureResolution=='2','clarity settings lost')
|
||||
-- Sparse 200ms hitches escape p99 but MUST reject a candidate. Only low tiers
|
||||
-- are smooth here, so the chosen tier should stop at 2, with a capped validation.
|
||||
where='none';P.hardwareProfile={};P.OptimizerCommand('60')
|
||||
for i=1,66*600 do
|
||||
local dt=(tonumber(cvars.graphicsShadowQuality)>=2 and i%330==0) and .2 or 1/66
|
||||
frames(1,dt)
|
||||
end
|
||||
d=RuenUIDB.optimizer
|
||||
assert(d.profiles.world.metTarget and d.profiles.world.tier==2,'brief stutters did not reject higher tier')
|
||||
local rejected=false
|
||||
for _,r in ipairs(d.profiles.world.history)do if r.over100>0 then rejected=true end end
|
||||
assert(rejected,'hitches not retained as evidence')
|
||||
-- Even a >2 second gameplay stall is counted; never silently drop it.
|
||||
P.OptimizerCommand('60')
|
||||
for i=1,66*400 do frames(1,i%330==0 and 2.5 or 1/66)end
|
||||
assert(d.profiles.world.calibrated and not d.profiles.world.metTarget and d.profiles.world.tier==1)
|
||||
assert(d.profiles.world.last.worstMS>=2500 and d.profiles.world.last.over250>0)
|
||||
-- Known loading periods are not gameplay; a fresh window follows them.
|
||||
P.OptimizerCommand('60');frames(66*12,1/66)
|
||||
f.scripts.OnEvent(f,'PLAYER_LEAVING_WORLD');frames(5,5)
|
||||
f.scripts.OnEvent(f,'PLAYER_ENTERING_WORLD');frames(66*600,1/66)
|
||||
assert(d.profiles.world.metTarget and d.profiles.world.last.worstMS<20)
|
||||
-- Invalid requests do not change target or start a measurement.
|
||||
before=writes;P.OptimizerCommand('19');P.OptimizerCommand('999');P.OptimizerCommand('world bad');P.OptimizerCommand('60 30')
|
||||
assert(writes==before and not P.IsOptimizerCalibrating())
|
||||
-- FPS changed explicitly, report freshness/thermal ceiling, clean pause/undo.
|
||||
P.hardwareProfile={checkedAt=clock,loaded=true,thermalPressure=true}
|
||||
P.OptimizerCommand('60');assert(d.target==45 and d.ceiling==2)
|
||||
P.OptimizerCommand('30');assert(d.target==30 and d.requestedFPS==30)
|
||||
P.OptimizerCommand('pause');assert(not f.scripts.OnUpdate and not d.enabled)
|
||||
P.IsBenchmarkRunning=function()return true end;before=writes
|
||||
P.OptimizerCommand('60');assert(writes==before and not d.enabled)
|
||||
P.IsBenchmarkRunning=nil
|
||||
-- Unsupported options remain unchanged; a rejected write cannot be called applied.
|
||||
IsGraphicsSettingValueSupported=function(k)return k=='graphicsLightMode' and 1 or 0 end
|
||||
cvars.graphicsLightMode='2';P.OptimizerCommand('30');frames(33*600,1/33)
|
||||
assert(d.profiles.world.unsupported.graphicsLightMode and cvars.graphicsLightMode=='2')
|
||||
P.OptimizerCommand('pause')
|
||||
print('PASS: headroom calibration, separate real-world/raid tests, actual frame percentiles, combat deferral, thermal input, pause and exact undo')
|
||||
print('PASS: real frame tails/hitches, scene retest, capped validation, four environments, combat/loading guards, target parsing, unsupported settings, hardware evidence, exact restore and idle sleep')
|
||||
|
||||
-- A different environment reached during a benchmark must wait until it ends.
|
||||
P.OptimizerCommand('resume');frames(33*600,1/33)
|
||||
P.IsBenchmarkRunning=function()return true end
|
||||
where='party';before=writes;f.scripts.OnEvent(f,'ZONE_CHANGED_NEW_AREA')
|
||||
assert(writes==before and not f.scripts.OnUpdate)
|
||||
P.IsBenchmarkRunning=nil;P.OptimizerBenchmarkEnded()
|
||||
assert(P.IsOptimizerCalibrating() and writes>before)
|
||||
frames(33*600,1/33);P.OptimizerCommand('pause')
|
||||
print('PASS: deferred environment handoff resumes after read-only benchmark')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user