mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-29 07:57:14 +00:00
feat(ugc): processing options per make, recorded per model with their times
Staff can make models again with other processing options than the UGC
settings' (ray backend, hidden-face method, denoising) and every make records
what made it, for comparing the options.
- migration mysql 99 / sqlite 82 (ugc_process_options): ugc.process_options
(picked for the next make, cleared once made), ugc.made_options (what made
the current files) and ugc_process_runs (every successful make: options,
wall and CPU time, hidden faces', occlusion's and icon's time, bricks,
triangles before and after)
- IUgc: ResetUgcModelProcessing and ResetPropertyUgcModelProcessing take the
options; PendingModel carries them; RecordUgcModelRun, GetUgcRunSummaries;
list entries have madeOptions and processOptions
- the UGC server applies a job's options over its settings and records the run
- /api/ugc/reprocess takes options ("embree fast oidn"); /api/ugc/options
lists the choices, the settings' defaults and averages per combination
- /reprocessproperty [builtin|embree|hiprt] [toolbox|fast] [off|oidn], any
order, all optional
Check: run the migration on MySQL and SQLite; /reprocessproperty embree fast
on a property, then the models' made_options and ugc_process_runs rows;
/api/ugc/options.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -79,6 +79,7 @@ public:
|
||||
std::string lxfml;
|
||||
uint32_t attempts{};
|
||||
bool priority{}; // staff asked for it to be made again: before any other model
|
||||
std::string options; // the processing options staff picked for this make (UgcProcessOptions), empty: the settings'
|
||||
};
|
||||
|
||||
// Up to `limit` pending models whose quiet period is over (process_after): the priority ones first, then the least
|
||||
@@ -91,7 +92,8 @@ public:
|
||||
virtual void ExpediteUgcModels(const LWOOBJID characterId) = 0;
|
||||
|
||||
// Records an attempt: the new state, how many attempts there have been, why it failed (empty when it didn't) and
|
||||
// whether lighting was baked in; processed_at becomes now
|
||||
// whether lighting was baked in; processed_at becomes now. Once it isn't pending any more, the priority and the
|
||||
// processing options staff picked for it are cleared.
|
||||
virtual void SetUgcModelProcessed(const LWOOBJID id, const eProcessState state, const uint32_t attempts, const std::string_view error, const bool bakeAo) = 0;
|
||||
|
||||
// What the UGC server counted when it made a model: its bricks and the most detailed mesh's triangles, after and
|
||||
@@ -106,15 +108,50 @@ public:
|
||||
};
|
||||
virtual void SetUgcModelProcessStats(const LWOOBJID id, const ProcessStats& stats) = 0;
|
||||
|
||||
// A successful make of a model with the processing options that made it (UgcProcessOptions, every choice filled)
|
||||
// and what it took (stats.json's times), for comparing the options
|
||||
struct ProcessRun {
|
||||
LWOOBJID id{};
|
||||
std::string options;
|
||||
uint32_t milliseconds{};
|
||||
uint32_t cpuMilliseconds{};
|
||||
uint32_t hsrMilliseconds{}; // removing hidden faces, every level
|
||||
uint32_t aoMilliseconds{}; // the occlusion bake, every level
|
||||
uint32_t iconMilliseconds{};
|
||||
uint32_t bricks{};
|
||||
uint32_t trianglesBefore{}; // the most detailed level's, before and after hidden faces were removed
|
||||
uint32_t triangles{};
|
||||
};
|
||||
|
||||
// Records a run (ugc_process_runs) and that the options made the model's files (made_options)
|
||||
virtual void RecordUgcModelRun(const ProcessRun& run) = 0;
|
||||
|
||||
// The runs summed per options, the most used first
|
||||
struct RunSummary {
|
||||
std::string options;
|
||||
uint64_t runs{};
|
||||
uint64_t models{}; // different models
|
||||
uint64_t milliseconds{}; // summed, as the rest
|
||||
uint64_t cpuMilliseconds{};
|
||||
uint64_t hsrMilliseconds{};
|
||||
uint64_t aoMilliseconds{};
|
||||
uint64_t iconMilliseconds{};
|
||||
uint64_t bricks{};
|
||||
uint64_t trianglesBefore{};
|
||||
uint64_t triangles{};
|
||||
};
|
||||
virtual std::vector<RunSummary> GetUgcRunSummaries() = 0;
|
||||
|
||||
virtual std::optional<ProcessInfo> GetUgcProcessInfo(const LWOOBJID id) = 0;
|
||||
|
||||
// Sets models back to pending with no attempts: one (`id`), or all of them (`id` nullopt; only the failed ones
|
||||
// with `failedOnly`). Returns how many rows changed.
|
||||
virtual uint64_t ResetUgcModelProcessing(const std::optional<LWOOBJID> id, const bool failedOnly) = 0;
|
||||
// with `failedOnly`). `options`: the processing options for the next make (UgcProcessOptions), empty: the
|
||||
// settings'. Returns how many rows changed.
|
||||
virtual uint64_t ResetUgcModelProcessing(const std::optional<LWOOBJID> id, const bool failedOnly, const std::string_view options) = 0;
|
||||
|
||||
// Sets every model placed on a property back to pending with no attempts, as priority (staff asked for it). Returns
|
||||
// how many rows changed.
|
||||
virtual uint64_t ResetPropertyUgcModelProcessing(const LWOOBJID propertyId) = 0;
|
||||
// Sets every model placed on a property back to pending with no attempts, as priority (staff asked for it), with
|
||||
// `options` for the next make as above. Returns how many rows changed.
|
||||
virtual uint64_t ResetPropertyUgcModelProcessing(const LWOOBJID propertyId, const std::string_view options) = 0;
|
||||
|
||||
// A page of models (all, or those in `state`), the newest first; `search` (when not empty) matches the model's id
|
||||
// exactly or part of its owner's name
|
||||
|
||||
@@ -41,6 +41,8 @@ public:
|
||||
uint32_t processMemoryKb{}; // the memory the UGC server estimated for it (not measured)
|
||||
std::string modelName; // models: the name a player gave it where it is placed (empty: none)
|
||||
uint32_t trianglesBefore{}; // models: the most detailed level's triangles before hidden faces were removed (0: unknown)
|
||||
std::string madeOptions; // models: the processing options that made its files (UgcProcessOptions; empty: unknown)
|
||||
std::string processOptions; // models: the options staff picked for its next make (empty: the settings')
|
||||
};
|
||||
|
||||
// What SearchUgc matches. A number (when set) is matched against ids; text against names
|
||||
|
||||
@@ -31,10 +31,11 @@ namespace UgcLookupSql {
|
||||
return (modular
|
||||
? "SELECT b.ugc_id AS id, b.character_id, c.name AS character_name, COALESCE(c.account_id, 0) AS account_id, a.name AS account_name, "
|
||||
"b.is_optimized, b.process_error, b.ldf_config AS detail, b.process_attempts, b.processed_at, 0 AS process_after, 0 AS bake_ao, "
|
||||
"0 AS brick_count, 0 AS triangle_count, b.process_ms, b.process_cpu_ms, b.process_memory_kb, '' AS model_name, 0 AS triangle_count_before "
|
||||
"0 AS brick_count, 0 AS triangle_count, b.process_ms, b.process_cpu_ms, b.process_memory_kb, '' AS model_name, 0 AS triangle_count_before, "
|
||||
"'' AS made_options, '' AS process_options "
|
||||
: "SELECT u.id, u.character_id, c.name AS character_name, u.account_id, a.name AS account_name, "
|
||||
"u.is_optimized, u.process_error, u.filename AS detail, u.process_attempts, u.processed_at, u.process_after, u.bake_ao, "
|
||||
"u.brick_count, u.triangle_count, u.process_ms, u.process_cpu_ms, u.process_memory_kb, u.triangle_count_before, "
|
||||
"u.brick_count, u.triangle_count, u.process_ms, u.process_cpu_ms, u.process_memory_kb, u.triangle_count_before, u.made_options, u.process_options, "
|
||||
// The name a player gave the model where it is placed (empty: none)
|
||||
"COALESCE((SELECT pc.model_name FROM properties_contents AS pc WHERE pc.ugc_id = u.id AND pc.model_name <> '' LIMIT 1), '') AS model_name ") + From(modular);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user