��ࡱ�;�� F�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ���� !"#$%&'()*+,-./0123456789:;<=>?@ABCDE����G������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Root Entry���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ���� �FMicrosoft Word-Dokument MSWordDocWord.Document.8�9�q�������Oh��+'��0|8 @ L X d p��712@�6a5C@@� ��k�@*% �j�����՜.��+,��D��՜.��+,��\����T [^��^Normal 1$*$A$3B*OJQJCJmH sH KHPJnHtH^JaJ_H9V�V heading 2 & F@&���xOJQJCJ$5PJ^JaJ$\F�FHeading ���x$OJQJCJPJ^JaJ4B4 Body Textd��� / List^J@""@caption �x�x $CJ6^JaJ]&�2&Index $^JB�BBcaption1 �x�x $CJ6^JaJ]D�RD caption11 �x�x $CJ6^JaJ]F�bF caption111 �x�x $CJ6^JaJ]H�rH caption1111 �x�x $CJ6^JaJ]J��J caption11111 �x�x $CJ6^JaJ]L��L caption111111 �x�x $CJ6^JaJ]N��Ncaption1111111 �x�x $CJ6^JaJ]P��Pcaption11111111 �x�x $CJ6^JaJ]R��Rcaption111111111 �x�x $CJ6^JaJ]T��Tcaption1111111111 �x�x $CJ6^JaJ]V��Vcaption11111111111 �x�x $CJ6^JaJ]X��Xcaption111111111111 �x�x $CJ6^JaJ]Z�Zcaption1111111111111 �x�x $CJ6^JaJ]\�\caption11111111111111 !�x�x $CJ6^JaJ]^�"^caption111111111111111 "�x�x $CJ6^JaJ]`�2`caption1111111111111111 #�x�x $CJ6^JaJ]b�Bbcaption11111111111111111 $�x�x $CJ6^JaJ]d�Rdcaption111111111111111111 %�x�x $CJ6^JaJ]f�bfcaption1111111111111111111 &�x�x $CJ6^JaJ]h�rhcaption11111111111111111111 '�x�x $CJ6^JaJ]j��jcaption111111111111111111111 (�x�x $CJ6^JaJ]l��lcaption1111111111111111111111 )�x�x $CJ6^JaJ]n��ncaption11111111111111111111111 *�x�x $CJ6^JaJ]p��pcaption111111111111111111111111 +�x�x $CJ6^JaJ]r��r caption1111111111111111111111111 ,�x�x $CJ6^JaJ]t��t!caption11111111111111111111111111 -�x�x $CJ6^JaJ]v��v"caption111111111111111111111111111 .�x�x $CJ6^JaJ]x��x#caption1111111111111111111111111111 /�x�x $CJ6^JaJ]z�z$caption11111111111111111111111111111 0�x�x $CJ6^JaJ]|�|%caption111111111111111111111111111111 1�x�x $CJ6^JaJ]~�"~&caption1111111111111111111111111111111 2�x�x $CJ6^JaJ]��2�'caption11111111111111111111111111111111 3�x�x $CJ6^JaJ]��B�(caption111111111111111111111111111111111 4�x�x $CJ6^JaJ]��R�)caption1111111111111111111111111111111111 5�x�x $CJ6^JaJ]��b�*caption11111111111111111111111111111111111 6�x�x $CJ6^JaJ]��r�+caption111111111111111111111111111111111111 7�x�x $CJ6^JaJ]����,caption1111111111111111111111111111111111111 8�x�x $CJ6^JaJ]����-caption11111111111111111111111111111111111111 9�x�x $CJ6^JaJ]����.caption111111111111111111111111111111111111111 :�x�x $CJ6^JaJ]����/caption1111111111111111111111111111111111111111 ;�x�x $CJ6^JaJ]����0caption11111111111111111111111111111111111111111 <�x�x $CJ6^JaJ]����1caption111111111111111111111111111111111111111111 =�x�x $CJ6^JaJ]����2caption1111111111111111111111111111111111111111111 >�x�x $CJ6^JaJ]����3caption11111111111111111111111111111111111111111111 ?�x�x $CJ6^JaJ]���4caption111111111111111111111111111111111111111111111 @�x�x $CJ6^JaJ]���5caption1111111111111111111111111111111111111111111111 A�x�x $CJ6^JaJ]��"�6caption11111111111111111111111111111111111111111111111 B�x�x $CJ6^JaJ]��2�7caption111111111111111111111111111111111111111111111111 C�x�x $CJ6^JaJ]��B�8caption1111111111111111111111111111111111111111111111111 D�x�x $CJ6^JaJ]��R�9caption11111111111111111111111111111111111111111111111111 E�x�x $CJ6^JaJ]��b�:caption111111111111111111111111111111111111111111111111111 F�x�x $CJ6^JaJ]��r�;caption1111111111111111111111111111111111111111111111111111 G�x�x $CJ6^JaJ]����<caption11111111111111111111111111111111111111111111111111111 H�x�x $CJ6^JaJ]����=caption111111111111111111111111111111111111111111111111111111 I�x�x $CJ6^JaJ]����>caption1111111111111111111111111111111111111111111111111111111 J�x�x $CJ6^JaJ]����?caption11111111111111111111111111111111111111111111111111111111 K�x�x $CJ6^JaJ]����@caption111111111111111111111111111111111111111111111111111111111 L�x�x $CJ6^JaJ]����Acaption1111111111111111111111111111111111111111111111111111111111 M�x�x $CJ6^JaJ]����Bcaption11111111111111111111111111111111111111111111111111111111111 N�x�x $CJ6^JaJ]����Ccaption111111111111111111111111111111111111111111111111111111111111 O�x�x $CJ6^JaJ]���Dcaption1111111111111111111111111111111111111111111111111111111111111 P�x�x $CJ6^JaJ]���Ecaption11111111111111111111111111111111111111111111111111111111111111 Q�x�x $CJ6^JaJ]D�"DHeader and FooterR �z�& $$ !2$footerS $$X����&P)�,&P*+����������^�`���^�`���^�`���^�`���^�`���^�`���^�`���^�`���^�`��������$$P G�Times New Roman5�Symbol3&�ArialG�Times New Roman5�SimSun?�DejaVu Sans3&�Arial7�STXihei?$�DejaVu SansB��h��h ���#����#' 0 0��M ��0&PCaolan80 =X$��)��*����!�!�!�! �!�# �#�%b�#�!�#�#�# �0:00 Hello, I am Yu Liu from the Control Group at the Accelerator Division of IHEP; I work both in beamline control and in experiment software at HEPS. I am presenting to you about our attempts at the systematic simplification of IOC development and deployment. We begin with the official IOCs for Xspress3, which belong to 2 main branches: the older QD IOC and the newer CARS IOC. Our issues with the official IOCs mainly arise from customisation, for instance when there is no prebuilt configuration for a certain setup. 0:55 The QD IOC has many duplicated files for different configurations, and there is also severe code duplication in its db and cmd files. The code in these files were created with the iocbuilder code generator, which is complex and also has complex dependencies. The CARS IOC has much less duplicated files, but there is still some obvious file and code duplication; the differences between similar configurations, like those 4-channel ones, are also unclear. We can see that even with the CARS IOC, mass copy/paste of code still creates difficulty in customisation. 1:50 We refactored these official IOCs and created ADXspress3. This IOC only uses a very simple code generator, but there is still very little duplication. ADXspress3 is straightforward to use, easy to customise, and more standardised in many aspects. Features from both upstreams were merged, and compatibility modes are provided. The refactoring was split into steps either manually verifiable or reproducible with simple commands; this debuggable process allows us to easily merge upstream changes, and even helps to find upstream bugs. 2:40 Similarly, Graham observed that a programmer writes the same amount of code per hour regardless of the language used. We may conclude that compressing complexity is compressing cost, and we will see the compression ratio can be in multiple orders of magnitude. This holds for both static code and code changes; the latter can be seen from the refactoring process above. By locating and reducing duplication, we can systematically reduce complexity. There are lower bounds for information compression, intuitively corresponding to the amount of some essential information, as well as the balance between cost and gain of compression. With given constraints on factors like functionalities and performance, estimation of the lower bounds can help to locate duplication, estimate costs and so on. 3:55 Manual installation of EPICS usually costs lots of time and manpower, while the essential information we need to pass to an automated installer would be like  I want EPICS base, motor and areaDetector . With packages from ihep-pkg, we pass it to the yum install command, and the modules are ready in less than 1 minute. ihep-pkg aims to be easily maintainable: as can be seen from the example below, our packaging scripts are very simple, with little redundancy. Based on these packaging code, ihep-pkg now also provides the mingw-build set of scripts for systems currently unsupported by our packages. mingw-assemble creates a source directory reusable on target machines, and mingw-build is run on these machines to actually build EPICS environments after given preparation steps. 5:10 IOCs created with tools like makeBaseApp generally contain tens of files, but we usually just customise a few db or cmd files. ihep-pkg provides reusable modular IOCs, which can run with user-provided cmd files; these cmd files can be further modified to load more customised files, allowing for multiple IOC instances. We collect the customised files in ~/iocBoot, so they do not get overwritten on package updates. This also facilitates backups, and we estimate a beamline s EPICS configuration should be ultimately reproducible from a few MBs of compressed backups. To avoid duplication, similar techniques are used on StreamDevice IOCs, bare db files and so on. To avoid unnecessary rebuilds, IOCs from ihep-pkg are generally built with support for autosave and iocStats. 6:25 The official IOCs for certain devices, like Xspress3, are over-complex to configure, and we provide refactored versions of them to simplify configuration. Self-built IOCs are still often needed anyway, and we generally put them in ~/epics. In these cases ~/iocBoot can still be used to collect essential configuration files; with proper automation, similar techniques may be even applied to VME IOCs. The sequencer parts in seq-based IOCs can be isolated, so we can use readily available IOCs for the parts they manipulate. For self-built IOCs, like this one combining asynMotor and StreamDevice, we can gather patches, scripts and so on in ~/iocBoot, to facilitate automated installation of them. 7:35 When writing asyn-based IOCs, a first trouble is that we need to write the name for each PV many times in various forms. The amount of code that accordingly interacts with the device often adds to the trouble, and the problem becomes more severe with the increase of the number of PVs. The CA, PVA protocols and doCallbacksGenericPointer() have framerate upper-bounds of about a few kHz, resulting in issues with very high-speed readout of small frames from devices like PandABox. 8:25 GenICam is a standard for industrial cameras; to us a most important aspect of it is that compliant devices have SDK interfaces with what we call the  BCDEIS type system, which allows for the auto-adaption of PV sets to the feature sets of devices. Aravis is an open-source SDK for cameras supporting GigE/USB3 vision, 2 standards based on GenICam; based on Aravis and the ADGenICam module, the ADAraivs IOC can be used for many camera models. arv-tool extracts XML descriptions of feature sets, which makeDb converts to db files; drvUserCreate then maps PVs to feature IDs. We extended the ADGenICam class to support general GenICam-like devices like Ximea, which have less restrictions on the format of feature IDs; makeDb is extended to also accept a JSON-based format for device-specific crawlers. Numerical IDs can also be encoded in strings, like this where the suffix is only for the eyes, and ignored by the IOC. 10:00 While reusing the CA protocol, we can replace the internals of IOCs with simpler event loops that handle operations on PVs. So by combining the caproto library with regular Python event loops, the QueueIOC framework was created; we are also planning to support PVA. With this framework it is very easy to define PVs, for example the PVs here with suffixes  shuffle and  array ; this IOC reacts to  caput shuffle 1 here, updating  array with random values. By calling high-performance libraries like numpy, Python IOCs performance can be comparable to EPICS IOCs. With QueueIOC it is very easy to write StreamDevice-like IOCs, with access to the full power of Python. By treating other IOCs as the underlying control layer, it is also easy to write sequencer IOCs with QueueIOC. 11:20 Monochromators IOCs from the optics module are each more than one thousand lines, and have complex state machines, which make their code very hard to debug or reuse. One classical bug is that the IOCs may lock up when asked to move to the same position it is already at. QueueIOC systematically supports monochromators by providing small reusable state machines. In monochromator IOCs based on QueueIOC, we only need to write specialised code like the energy conversion functions, which can be tested in isolation. These IOCs are more than 10 times shorter than those from optics, and easily maintainable. 12:20 Based on QueueIOC, QDetectorIOC was created for detector integration; it can easily switch between different ways to output data. With side channels the data is sent directly to the postprocessing server to reduce performance loss, and the IOC only reads frame counters. Our ZeroMQ-based protocol can transmit multiple frames at once, greatly reducing the per-frame overhead. These IOCs are based on self-made  SDKs to isolate complexity. They thinly wrap around vendor interfaces for performance; externally they expose friendly, reusable interfaces, often GenICam-like with strong regularity. Based on them, a programs for Tucsen can be easily adapted for Hamamatsu and so on; we even wrapped the very GenICam-unlike vendor SDK of Rigaku XSPA into a GenICam-like self-made  SDK . So most QDetectorIOC code are succinct and consistent with each other; we also plan to write ADGenICam-based IOCs with these  SDKs . 13:45 With the techniques above, we prefer bare-metal IOC deployment over containerisation and virtualisation. Essentially, we prefer to use the right tools for the right things; this also applies for instance in our work on Mamba. All above are done with human intelligence, in intelligible and economical ways. We wish to see a balance between it and AI that minimises the cost. The amount of information a human can process in a fixed time period is constant, so human intelligence coincides with the capability to minimise complexity, which corresponds to Hutter s treatment of AI as information compression. Therefore doing the work above with AI may require some kind of AGI; we hope our work can contribute to the coevolution of human intelligence and AI. Thank you. &P    $ & ��������  6!@!B!R'T'^'`'�,�,�,����������������������������$a$$A$$a$A$�,�,�0�0�0�0�7�7�7>>> >�B�B�B�BJJ"J$J$P&P����������������������$a$$A$$a$A$;<0@PBP��/ ��=!�n"�n#�n$�n2P1�h0p3P(20Root Entry�������� �FCompObj����jOle ��������1Table������������M(SummaryInformation(�����WordDocument������������=XDocumentSummaryInformation8������������t����������������
Baidu
map