Refactor simc engine to make it useable as a library
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Start by reading the listed progress_bar_t::update workaround in engine/sim/sc_progress_bar.cpp, then compare the Qt GUI and CLI setup and report paths mentioned in the issue. The work spans progress callbacks, writing reports to buffers, and sim_t initialization and execution, so first clarify the desired API and scope with maintainers. Done means the agreed library use cases no longer require the workarounds described here.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Because of my effort to create a web assembly version of simc in #4341 I identified the following issues that need some work to make it useable as a library. The goal is to have a discussion about them and do the refactoring.
Progress reporting
The progress bar is outputted as formatted text to stdout. What an embedded application (like the browser) needs is a way to get notified about progress update with structured data. My proposal is to have a mode where I supply a functor (callback) that gets called after each iteration. When specifying the callback an update interval can be specified too.
I currently have the following workaround in progress_bar_t::update to get progress updates:
#ifdef SC_WASM
{
wasm_hooks::update_progress( progress, current_progress(),
compute_total_phases(),
base_str, phase_str );
return false;
}
#endif
This suppresses progress bar output and supplies my application with the information I need.
Result output
Currently the different report classes either output to a file or to stdout. What I need is a mode where I can just write the reports to a buffer. For example an overload of
report::print_json(simc, std::stringstream &out). I need this for the json case because that format is used to pass the information to javascript in the WebAssembly case. Text could be helpful, too. Currently I just write out the json file by setting json_file_str and read it back in after the sim as a workaround.
Setup Boilerplate
I found it difficult to find all the calls that I need to make before I can sim. After reading the qt gui and cli code I came up with that:
dbc::init();
module_t::init();
unique_gear::register_hotfixes();
unique_gear::register_special_effects();
unique_gear::sort_special_effects();
hotfix::apply();
I do not even know if that is all or how to track new things that need to be added. Maybe it can be integrated into the sim_t constructor which initializes this with something like std::call_once to not redo it again for each instance. And also make it callable ahead of time, optionally. For example a static sim_t::initialize() which can be called manually or is called by the first constructor call if not.
Also it is not obvious to me which functions I need to call after the sim. For example all the analyze() functions. Can that be integrated at the end of execute() ?
And maybe sim_t::setup() can be moved to the constructor so it is obvious that I need a control object. So we do don't have a standard constructor but one that takes the options.
All in all I think the goal should be that by constructing a sim_t we should have an instance that is ready to roll without having to call further init or setup functions.
- Lingua principale
- C++
- Stelle
- 1.6k
- Fork
- 789
- Merge medio
- 8h 18m
- PR unite (30g)
- 63
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di simulationcraft/simc
-
Arms slayer_st APL bugAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
simulationcraft/simc#11747 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
simulationcraft/simc#11935 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
simulationcraft/simc#11918 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Timewalking Item Level BugAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
simulationcraft/simc#11845 ·
I maintainer di solito rispondono entro 1 giorno
-
demonhunter.initial_furyAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
simulationcraft/simc#11752 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di simulationcraft/simc
Issue simili
-
v9.6.0: CMake incorrectly enforces presence of libevdevForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
mltframework/shotcut#1943 ·
I maintainer di solito rispondono entro 1 giorno
-
Rowan (2017) electron heating gives NaN for beta > beta_max; clip() then sets electrons to kel_minAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
parthenon-hpc-lab/kharma#213 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
metasequoiaime/msime#9113 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
tone-3000/tone3000-plugin#257 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno